poly - Characteristic polynomial of matrix

Syntax

p = poly(A)
p = poly(A, v)

Description

If A is a numeric array, p = poly(A) returns the coefficients of the characteristic polynomial of A. If A is symbolic, poly(A) returns the characteristic polynomial of A in terms of the default variable x.

Note that if A is numeric, poly(sym(A)) approximately equals poly2sym(poly(A)). The approximation is due to roundoff error.

p = poly(A, v) specifies to use the second input argument, v, in place of the default variablex.

Examples

The statements

syms z
A = gallery(3) 
p = poly(A)
q = poly(sym(A))
s = poly(sym(A),z)

return

A = 
  -149   -50  -154
   537   180   546
   -27    -9   -25

p = 
1.0000   -6.0000   11.0000   -6.0000

q=
x^3-6*x^2+11*x-6

s =
z^3-6*z^2+11*z-6

See Also

poly2sym, jordan, eig, solve

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS