Eigenvalues corresponds to eigenvectors
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
AVM
el 8 de Feb. de 2020
Comentada: Vladimir Sovkov
el 9 de Feb. de 2020
In matlab, the command [V,L]=eig(h) produces the eigenvectors and eigenvalues of the square matirx h. But I would like to know in which order this eigenvectors appear? I mean how can I observe that which eigenvalues corresponds to which eigenvectors. I am really confused at this point. Pl somebody help me to understand this. Here I have taken an example.
clc;clear;
syms a b c
h=[a 0 1 0;0 b 2 0;1 0 c 0;0 3 0 a];
[V,L]=eig(h)
This produces the output as
V =
[ 0, 0, a/12 - b/6 + c/12 - (a^2 - 2*a*c + c^2 + 4)^(1/2)/12, a/12 - b/6 + c/12 + (a^2 - 2*a*c + c^2 + 4)^(1/2)/12]
[ 0, b/3 - a/3, c/6 - a/6 - (a^2 - 2*a*c + c^2 + 4)^(1/2)/6, c/6 - a/6 + (a^2 - 2*a*c + c^2 + 4)^(1/2)/6]
[ 0, 0, (a*b)/6 - (a*c)/6 - (b/6 - c/6)*(a/2 + c/2 - (a^2 - 2*a*c + c^2 + 4)^(1/2)/2) + 1/6, (a*b)/6 - (a*c)/6 - (b/6 - c/6)*(a/2 + c/2 + (a^2 - 2*a*c + c^2 + 4)^(1/2)/2) + 1/6]
[ 1, 1, 1, 1]
L =
[ a, 0, 0, 0]
[ 0, b, 0, 0]
[ 0, 0, a/2 + c/2 - (a^2 - 2*a*c + c^2 + 4)^(1/2)/2, 0]
[ 0, 0, 0, a/2 + c/2 + (a^2 - 2*a*c + c^2 + 4)^(1/2)/2]
But how do I associate the eigenvector with its corresponding eigenvealue.
0 comentarios
Respuesta aceptada
Vladimir Sovkov
el 8 de Feb. de 2020
Absolutely standard: L(k,k) ~ V(:,k).
You can check it with the code:
for k=1:size(h,1)
disp(strcat('k=',num2str(k),'; h*v-lambda*v=',num2str(double(norm(simplify(h*V(:,k) - L(k,k)*V(:,k)))))));
end
10 comentarios
Vladimir Sovkov
el 9 de Feb. de 2020
The array indexing is described at https://www.mathworks.com/help/matlab/math/array-indexing.html?searchHighlight=matrix%20indexing&s_tid=doc_srchtitle
E.g., you address the entire k-th column of a matrix as V(:,k).
Más respuestas (0)
Ver también
Categorías
Más información sobre Particle & Nuclear Physics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!