Characteristic polynomial of matrix
a vector of the coefficients of the characteristic polynomial of
A is a symbolic matrix,
a symbolic vector. Otherwise, it returns a vector of double-precision
Free symbolic variable.
Default: If you do not specify
Compute the characteristic polynomial of the matrix
terms of the variable
syms x A = sym([1 1 0; 0 1 0; 0 0 1]); charpoly(A, x)
ans = x^3 - 3*x^2 + 3*x - 1
To find the coefficients of the characteristic polynomial of
charpoly with one argument:
A = sym([1 1 0; 0 1 0; 0 0 1]); charpoly(A)
ans = [ 1, -3, 3, -1]
Find the coefficients of the characteristic polynomial of the
A. For this matrix,
the symbolic vector of coefficients:
A = sym([1 2; 3 4]); P = charpoly(A)
P = [ 1, -5, -2]
Now find the coefficients of the characteristic polynomial of
B, all elements of which are double-precision
values. Note that in this case
coefficients as double-precision values:
B = ([1 2; 3 4]); P = charpoly(B)
P = 1 -5 -2
The characteristic polynomial of an n-by-n matrix
the polynomial pA(x),
Here In is the n-by-n identity matrix.
 Cohen, H. “A Course in Computational Algebraic Number Theory.” Graduate Texts in Mathematics (Axler, Sheldon and Ribet, Kenneth A., eds.). Vol. 138, Springer, 1993.
 Abdeljaoued, J. “The Berkowitz Algorithm, Maple and Computing the Characteristic Polynomial in an Arbitrary Commutative Ring.” MapleTech, Vol. 4, Number 3, pp 21–32, Birkhauser, 1997.