Obtain eigenvalue from matrix and known eigenvector
Show older comments
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?
Accepted Answer
More Answers (1)
David Goodmanson
on 10 Jun 2019
Edited: David Goodmanson
on 10 Jun 2019
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.
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!