Y = polyvalm(p,S)
polyvalm(p,S) evaluates a polynomial in a matrix sense. p is a vector whose elements are the coefficients of a polynomial in descending powers, and S is a square matrix
Its characteristic polynomial can be generated with theS = pascal(4)S =1 1 1 11 2 3 41 3 6 101 4 10 20
poly function.
This represents the polynomialp = poly(S)p =1 -29 72 -29 1
Pascal matrices have the curious property that the vector of coefficients of the characteristic polynomial is palindromic - it is the same forward and backward.
Evaluating this polynomial at each element of S is not very interesting.
But evaluating it in a matrix sense is interesting.polyval(p,S)ans =16 16 16 1616 15 -140 -56316 -140 -2549 -1208916 -563 -12089 -43779
The result is the zero matrix. This is an instance of the Cayley-Hamilton theorem: a matrix that satisfies its own characteristic equation.polyvalm(p,S)ans =0 0 0 00 0 0 00 0 0 00 0 0 0
conv,poly,polyval,residue,roots
(c) Copyright 1994 by The MathWorks, Inc.