minpoly
Minimal polynomial of a matrix.
Category: Mathematics > Polynomials
Syntax
p = minpoly(A)
Coefficient vector of the minimal polynomial of A, highest power first.
p = minpoly(A, x)
Minimal polynomial as an expression in the symbolic variable x.
Description
The minimal polynomial of a matrix A is the monic polynomial of lowest degree that vanishes at A. It divides the characteristic polynomial and has the same roots, but each root may appear with a smaller multiplicity. The two coincide when the matrix has no repeated eigenvalue with several independent eigenvectors.
For the 2-by-2 matrix 2*I the characteristic polynomial is (x - 2)^2, while the minimal polynomial is just x - 2. This is the minimal polynomial of a matrix, not of an algebraic number: for a scalar a, it is x - a.
Input arguments
A- Square numeric or symbolic matrix.
x- Symbolic variable for the polynomial form.
Output arguments
p- Coefficients (row vector) or a polynomial in
x.
Example
Compare with the characteristic polynomial
syms x
A = sym([2 0; 0 2]);
minpoly(A, x)
charpoly(A, x)
minpoly(sym([1 2; 3 4]), x)
Output
ans = x - 2
ans = x^2 - 4*x + 4
ans = x^2 - 5*x - 2