Obtain eigenvalue from matrix and known eigenvector
显示 更早的评论
I have a matrix A and a known eigenvector x. I am struggling to come up with an way of obtaining the eigenvalue of x with a relatively simple operation. One option is the following code:
A*x./x
However, this has problems when x contains any 0 entries. Is there any easy way of accomplishing this?
采纳的回答
更多回答(1 个)
David Goodmanson
2019-6-10
编辑:David Goodmanson
2019-6-10
Hi Henry,
you can find the indices where x = 0 and cast those entries out of both x and the corresponding rows and columns of A.
x1 = x; % temporary copies
A1 = A;
ind = x1==0;
x1(ind) = [];
A1(:,ind) = [];
A1(ind,:) = [];
(A1*x1)./x1
In practice, the zero check might have to be something like ind = abs(x) < 1e-6 or whatever an appropriate tolerance would be.
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!