polyvalm
Matrix polynomial evaluation
Syntax
Description
Examples
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.0003 -0.0036 -0.0052 -0.0143
-0.0021 -0.0136 -0.0179 -0.0464
-0.0059 -0.0330 -0.0400 -0.1047
-0.0130 -0.0639 -0.0750 -0.1962
Input Arguments
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
Input matrix, specified as a square matrix.
Data Types: single
| double
Complex Number Support: Yes
Output Arguments
Output polynomial coefficients, returned as a row vector.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
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).
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)