# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

# polyvalm

Matrix polynomial evaluation

## Syntax

``Y = polyvalm(p,X)``

## Description

example

````Y = polyvalm(p,X)` returns the evaluation of polynomial `p` in a matrix sense. This evaluation is the same as substituting matrix `X` in the polynomial, `p`.```

## Examples

collapse all

Find the characteristic polynomial of a Pascal Matrix of order 4.

`X = pascal(4)`
```X = 1 1 1 1 1 2 3 4 1 3 6 10 1 4 10 20 ```
`p = poly(X)`
```p = 1.0000 -29.0000 72.0000 -29.0000 1.0000 ```

The characteristic polynomial is

Pascal matrices have the property that the vector of coefficients of the characteristic polynomial is the same forward and backward (palindromic).

Substitute the matrix, `X`, into the characteristic equation, `p`. The result is very close to being a zero matrix. This example is an instance of the Cayley-Hamilton theorem, where a matrix satisfies its own characteristic equation.

`Y = polyvalm(p,X)`
```Y = 1.0e-10 * -0.0013 -0.0063 -0.0104 -0.0241 -0.0048 -0.0217 -0.0358 -0.0795 -0.0114 -0.0510 -0.0818 -0.1805 -0.0228 -0.0970 -0.1553 -0.3396 ```

## Input Arguments

collapse all

Polynomial coefficients, specified as a vector. For example, the vector `[1 0 1]` represents the polynomial ${x}^{2}+1$, and the vector `[3.13 -2.21 5.99]` represents the polynomial $3.13{x}^{2}-2.21x+5.99$.

For more information, see Create and Evaluate Polynomials.

Data Types: `single` | `double`
Complex Number Support: Yes

Input matrix, specified as a square matrix.

Data Types: `single` | `double`
Complex Number Support: Yes

## Output Arguments

collapse all

Output polynomial coefficients, returned as a row vector.

## See Also

### Topics

#### Introduced before R2006a

Was this topic helpful?

#### The Manager's Guide to Solving the Big Data Conundrum

Download white paper