A = compan(c)
| Parameter | Description |
|---|---|
| c | a vector of polynomial coefficients, in descending powers. |
| Parameter | Description |
|---|---|
| A | the companion matrix whose first row is -c(2:end) / c(1) and whose first subdiagonal is ones. |
compan returns the companion matrix of the polynomial whose coefficients are c.
The eigenvalues of the companion matrix are the roots of the polynomial, so eig(compan(c)) and roots(c) return the same values.
For a vector of length n, the result is an (n-1)-by-(n-1) matrix. A single coefficient returns an empty matrix.
A = compan([1 -6 11 -6])
r = eig(A)
| Version | Description |
|---|---|
| 2.0.0 | initial version |