Determine eigvector through eigvalue without using eig

Hello. I am writing a script that uses the power method to calculate the principal and two lowest (or however the oposite of principal is) eigvalues of a couple of matrices.
For the last part i want to plot the eigvectors of the corresponding eigvalues but i dont want to use eig and havent been able to successfully use find to determine the position of the eigvals and therefore find the corresponding eigvectors.
Long story short i am looking for a way, in general, to find the corresponding eigvector of a matrix by only knowing the matrix and one of its eigvalues.
P.S. I think the code is irrelevant but just in case
clear
clc
format short
f = @(x) 2+sin(pi*x)
n=100
N=[1:n];
for i=1:n;
x(i)=i/n;
end
E=f(x);
K=-2*E;
L=E(1:n-1);
M=E(2:n);
A=diag(K)+diag(L,1)+diag(M,-1);
k=3000;
yo=ones(n,1);
for i=1:k
dian=A*yo;
yo=dian./max(abs(dian));
end
dian
disp('H megisth kata apolith timh idiotimh tou pinaka A einai:')
max(abs(dian))
max(abs(eig(A)))
B=(n^2)*A;
for i=1:k
dianB=B*yo;
yo=dianB./max(abs(dianB));
end
disp('H megisth kata apolith timh idiotimh tou pinaka B einai:')
max(abs(dianB))
max(abs(eig(B)))
Binv=inv(B);
for i=1:k
dianBinv=Binv*yo;
yo=dianBinv./max(abs(dianBinv));
end
disp('H elaxisth kata apolith timh idiotimh tou pinaka B einai:')
max(abs(dianBinv))
max(abs(eig(Binv)))

回答(2 个)

By definition, the eigenvectors are the null space of A-lambda*I.
Thus you can get the eigenvectors by
null(A-lambda*eye(size(A,1)))
Best wishes
Torsten.

类别

帮助中心File Exchange 中查找有关 Fractals 的更多信息

产品

版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by