Previous: Polynomial Interpolation, Up: Polynomial Manipulations
If a is a square N-by-N matrix,
poly (
a)
is the row vector of the coefficients ofdet (z * eye (N) - a)
, the characteristic polynomial of a. As an example we can use this to find the eigenvalues of a as the roots ofpoly (
a)
.roots(poly(eye(3))) 1.00000 + 0.00000i 1.00000 - 0.00000i 1.00000 + 0.00000iIn real-life examples you should, however, use the
eig
function for computing eigenvalues.If x is a vector,
poly (
x)
is a vector of coefficients of the polynomial whose roots are the elements of x. That is, of c is a polynomial, then the elements of d= roots (poly (
c))
are contained in c. The vectors c and d are, however, not equal due to sorting and numerical errors.See also: eig, roots.
Write formatted polynomial
c(x) = c(1) * x^n + ... + c(n) x + c(n+1)and return it as a string or write it to the screen (if nargout is zero). x defaults to the string
"s"
.See also: polyval, polyvalm, poly, roots, conv, deconv, residue, filter, polyderiv, and polyinteg.