Poly

Parent Previous Next

Poly


Calculate matrix characteristic polynomial



Syntax


poly(A)

A is a matrix

poly(A) where A is an n-by-n matrix returns an n+1 element row vector whose elements are the coefficients of the characteristic polynomial, det(λI – A). The coefficients are ordered in descending powers: if a vector c has n+1 components, the polynomial it represents is

poly(v)

v is a vector

Returns a row vector whose elements are the coefficients of the polynomial whose roots are the elements of v.


Example


Input

Output

a=[12,3,7,5,14;6,1,8,3,0;13,9,4,2,10;15,-2,-4,-7,-3;-1,-5,-10,-8,-9]

poly(a)

v=[1,2,3,4]

poly(v)


See Also


Created with the Personal Edition of HelpNDoc: Full-featured EPub generator