poly
Polynomial with specified roots or characteristic polynomial
Syntax
p = poly(r)
p = poly(A)
Description
p = poly(r),其中r是向量,返回其根是r元素的多项式的系数。
由多项式的根求多项式,由特征多项式的根,即特征值求特征多项式。
特征值的特征多项式
Calculate the eigenvalues of a matrix, A.
计算矩阵 A 的特征值
A = [1 8 -10; -4 2 4; -5 2 8]
A = 3×3
1 8 -10
-4 2 4
-5 2 8
e = eig(A)
e = 3×1 complex
11.6219 + 0.0000i
-0.3110 + 2.6704i
-0.3110 - 2.6704i
由于e中的特征值是A的特征多项式的根,因此使用poly从e中的值确定特征多项式。
p = poly(e)
p = 1×4
1.0000 -11.0000 -0.0000 -84.0000
所以特征多项式可以写为:
x^3 - 11x^2 - 84 = 0;
p = poly(A), 其中A是n×n矩阵,返回矩阵特征多项式的n + 1个系数det(λI-A)。
由矩阵返回特征多项式的系数。
Characteristic Polynomial of Matrix
Use poly to calculate the characteristic polynomial of a matrix, A.
A = [1 2 3; 4 5 6; 7 8 0]
A = 3×3
1 2 3
4 5 6
7 8 0
p = poly(A)
p = 1×4
1.0000 -6.0000 -72.0000 -27.0000
Calculate the roots of p using roots. The roots of the characteristic polynomial are the eigenvalues of matrix A.
r = roots(p)
r = 3×1
12.1229
-5.7345
-0.3884
再由根r来求其多项式y,可预期一样,y 和 p一致。
本文同步分享在 博客“李锐博恩”(CSDN)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。