Previous: Polynomial Interpolation, Up: Polynomial Manipulations [Contents][Index]

- Function File:
**poly***(*`A`) - Function File:
**poly***(*`x`) If

`A`is a square*N*-by-*N*matrix,`poly (`

is the row vector of the coefficients of`A`)`det (z * eye (N) - A)`

, the characteristic polynomial of`A`. For example, the following code finds the eigenvalues of`A`which are the roots of`poly (`

.`A`)roots (poly (eye (3))) ⇒ 1.00001 + 0.00001i 1.00001 - 0.00001i 0.99999 + 0.00000i

In fact, all three eigenvalues are exactly 1 which emphasizes that for numerical performance the

`eig`

function should be used to compute eigenvalues.If

`x`is a vector,`poly (`

is a vector of the coefficients of the polynomial whose roots are the elements of`x`)`x`. That is, if`c`is a polynomial, then the elements of

are contained in`d`= roots (poly (`c`))`c`. The vectors`c`and`d`are not identical, however, due to sorting and numerical errors.

- Function File:
**polyout***(*`c`) - Function File:
**polyout***(*`c`,`x`) - Function File:
`str`=**polyout***(…)* 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:**polyreduce.

- Function File:
**polyreduce***(*`c`) Reduce a polynomial coefficient vector to a minimum number of terms by stripping off any leading zeros.

**See also:**polyout.