what is method inside roots in matlab
显示 更早的评论
回答(1 个)
Torsten
2015-2-18
From the documentation:
The algorithm simply involves computing the eigenvalues of the companion matrix:
A = diag(ones(n-1,1),-1);
A(1,:) = -c(2:n+1)./c(1);
eig(A)
It is possible to prove that the results produced are the exact eigenvalues of a matrix within roundoff error of the companion matrix A, but this does not mean that they are the exact roots of a polynomial with coefficients within roundoff error of those in c.
Best wishes
Torsten.
2 个评论
puttgunta yaswanth
2015-2-18
Torsten
2015-2-18
Why not ?
c(1)=1;
c(2)=0;
c(3)=-2;
c(4)=-5;
n=3;
A = diag(ones(n-1,1),-1);
A(1,:) = -c(2:n+1)./c(1);
eig(A)
for your example.
Best wishes
Torsten.
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!