companCompanion matrix
A companion matrix
Roots of the polynomial
This can be seen by expressing
Roots of
compan(p)p is a vector containing coefficients of a polynomial, where p(1) and p(end) correspond to the highest and zeroth order terms, respectively.p(2)/p(1), p(3)/p(1), ..., p(end)/p(1) correspond to C, the roots of C. The roots and the eigenvalues are identical.p = [1 2 3];
c = compan(p)
eig(c)
roots(p)
c =
-2.0000 -3.0000
1.0000 0.0000
ans =
-1.0000 + 1.4142i
-1.0000 - 1.4142i
ans =
-1.0000 - 1.4142i
-1.0000 + 1.4142i