A = compan(p)
A = compan(p) where p is a vector of polynomial coefficients, returns the corresponding companion matrix whose first row is -p(2:n)/p(1).
The eigenvalues of compan(p) are the roots of the polynomial.
has a companion matrix given by
The eigenvalues are the polynomial roots:p = [1 0 -7 6]A = compan(p)A =0 7 -61 0 00 1 0
This is alsoeig(compan(p)) =-3.00002.00001.0000
roots(p).
eig,poly,polyval,roots
(c) Copyright 1994 by The MathWorks, Inc.