Let \(r\) be a nonconstant noncommutative rational function in m variables over an algebraically closed field \(\mathbb {K}\) of characteristic 0. We show that for n large enough, there exists an \(X\in {{\,\textrm{M}\,}}_{n}(\mathbb {K})^m\) such that \(r(X)\) has n distinct and nonzero eigenvalues. This result is used to study the linear and multiplicative Waring problems for matrix algebras. Concerning the linear problem, we show that for n large enough, every matrix in \(\mathfrak {sl}_{n}(\mathbb {K})\) can be written as \(r(Y)-r(Z)\) for some \(Y,Z\in {{\,\textrm{M}\,}}_{n}(\mathbb {K})^m\) . We also discuss variations of this result for the case where \(r\) is a noncommutative polynomial. Concerning the multiplicative problem, we show, among other results, that if f and g are nonconstant polynomials, then, for n large enough, every nonscalar matrix in \(\operatorname {GL}_{n}(\mathbb {K})\) can be written as \(f(Y)\cdot g(Z)\) for some \(Y,Z\in {{\,\textrm{M}\,}}_{n}(\mathbb {K})^m\) .