Evaluating Polynomials
The polyval function
evaluates a polynomial at a specified value. To evaluate p at s = 5, use
polyval(p,5)
ans =
110
It is also possible to evaluate a polynomial in a matrix sense.
In this case
becomes
, where X is a square matrix
and I is the identity matrix. For example, create
a square matrix X and evaluate the polynomial p at X:
X = [2 4 5; -1 0 3; 7 1 5];
Y = polyvalm(p,X)
Y =
377 179 439
111 81 136
490 253 639
 | Representing Polynomials | | Roots |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit