Azzera filtri
Azzera filtri

Determine eigvector through eigvalue without using eig

2 visualizzazioni (ultimi 30 giorni)
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)))

Risposte (2)

Torsten
Torsten il 20 Dic 2018
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.

Bruno Luong
Bruno Luong il 20 Dic 2018
null(A - lambda * eye(size(A))

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Prodotti


Release

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by