polyvalm
Matrix polynomial evaluation
Syntax
Description
Examples
Matrix Evaluation of Characteristic Polynomial
Find the characteristic polynomial of a Pascal Matrix of order 4.
X = pascal(4)
X = 4×4
1 1 1 1
1 2 3 4
1 3 6 10
1 4 10 20
p = poly(X)
p = 1×5
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 = 4×4
10-10 ×
-0.0014 -0.0064 -0.0105 -0.0242
-0.0049 -0.0220 -0.0362 -0.0801
-0.0116 -0.0514 -0.0827 -0.1819
-0.0230 -0.0976 -0.1567 -0.3424
Input Arguments
p
— Polynomial coefficients
vector
Polynomial coefficients, specified as a vector. For example,
the vector [1 0 1]
represents the polynomial ,
and the vector [3.13 -2.21 5.99]
represents the
polynomial .
For more information, see Create and Evaluate Polynomials.
Data Types: single
| double
Complex Number Support: Yes
X
— Input matrix
square matrix
Input matrix, specified as a square matrix.
Data Types: single
| double
Complex Number Support: Yes
Output Arguments
Y
— Output polynomial coefficients
row vector
Output polynomial coefficients, returned as a row vector.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Thread-Based Environment
Run code in the background using MATLAB® backgroundPool
or accelerate code with Parallel Computing Toolbox™ ThreadPool
.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
The polyvalm
function
fully supports GPU arrays. To run the function on a GPU, specify the input data as a gpuArray
(Parallel Computing Toolbox). For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Distributed Arrays
Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.
This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)