This functionality does not run in MATLAB.
linalg::charmat(A, x) returns the characteristic matrix x In - A of the n×n matrix A, where In denotes the n×n identity matrix.
The component ring of A must be a commutative ring, i.e., a domain of category Cat::CommutativeRing.
The characteristic matrix M = x In - A of A can be evaluated at a point x = u via evalp(M, x = u). See Example 2.
We define a matrix over the rational numbers:
A := Dom::Matrix(Dom::Rational)([[1, 2], [3, 4]])
and compute the characteristic matrix of A in the variable x:
MA := linalg::charmat(A, x)
The determinant of the matrix MA is a polynomial in x, the characteristic polynomial of the matrix A:
pA := det(MA)
Of course, we can compute the characteristic polynomial of A directly via linalg::charpoly:
The result is of the same domain type as the polynomial pA.
We define a matrix over the complex numbers:
B := Dom::Matrix(Dom::Complex)([[1 + I, 1], [1, 1 - I]])
The characteristic matrix of B in the variable z is:
MB := linalg::charmat(B, z)
We evaluate MB at z = i and get the matrix:
evalp(MB, z = I)
Note that this is a matrix of the domain type Dom::Matrix(Dom::Complex):
Matrix of the domain Dom::Matrix(Dom::DistributedPolynomial([x], R)) or of Dom::DenseMatrix(Dom::DistributedPolynomial([x], R)), where R is the component ring of A.