Obtain eigenvalue from matrix and known eigenvector

1 次查看(过去 30 天)
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?

采纳的回答

John D'Errico
John D'Errico 2019-6-10
编辑:John D'Errico 2019-6-10
The simple answer, as long as the vector x IS an eigenvector. is just:
val = norm(A*x)/norm(x);
You should see that this is not a problem if x has some zero entries, as long as x is not the vector that is entirely zero.
If x is not an eigenvector, then of course it won't work, but we are told that x is an eigenvector so there is no problem. Ok, it does assume that the eigenvalue in question is real. If that is an issue, then a simple solution is still available. For example:
A = rand(5);
[V,D] = eig(A);
diag(D)
ans =
2.80100746971912 + 0i
0.396075677494192 + 0.0659443099214011i
0.396075677494192 - 0.0659443099214011i
-0.322864111476007 + 0i
-0.285307095833035 + 0i
Now, can we recover the first eigenvalue? It is real.
norm(A*V(:,1))/norm(V(:,1))
ans =
2.80100746971912
Of course, that will fail for the second eigenvalue. But only you know if the eigenvalues and eigenvectors are real in your problem.
Just pick the largest element in magnitude of the corresponding eigenvector.
V2 = V(:,2);
[~,ind] = max(abs(V2));
Av2 = A*V2;
val = Av2(ind)/V2(ind)
val =
0.396075677494192 + 0.0659443099214012i
Indeed, we have recovered the eigenvalue. Again, this is not a problem if the eigenvector has SOME zero elements, because I picked a specific element that is known to be non-zero.

更多回答(1 个)

David Goodmanson
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.

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by