compan
Companion matrix.
📝Syntax
A = compan(c)
📥Input Arguments
Parameter Description
c a vector of polynomial coefficients, in descending powers.
📤Output Arguments
Parameter Description
A the companion matrix whose first row is -c(2:end) / c(1) and whose first subdiagonal is ones.
📄Description

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.

💡Examples
A = compan([1 -6 11 -6])
r = eig(A)
🔗See Also
rootspoly
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub