MATLAB Function Reference    
compan

Companion matrix

Syntax

Description

A = compan(u) returns the corresponding companion matrix whose first row is -u(2:n)/u(1), where u is a vector of polynomial coefficients. The eigenvalues of compan(u) are the roots of the polynomial.

Examples

The polynomial

has a companion matrix given by

The eigenvalues are the polynomial roots:

This is also roots(u).

See Also

eig, poly, polyval, roots


  comet3 compass