Calculating dominant eigenvector for each matrix in a large array

7 visualizaciones (últimos 30 días)
Jenna Parker
Jenna Parker el 3 de Abr. de 2020
Comentada: Jenna Parker el 6 de Abr. de 2020
Hi,
I am trying to write a for loop to make an array of dominant eigenvectors for each of the matrices in a 11 X 11 X 10,000 array. My problem is in decoupling the V of the [V,D] = eig(A). I hope the below code can give an idea of what I am trying to do, but please let me know if I need to be more clear about anything.
LHS_matrices;
R_EIGENVECTORS = zeros(nstages,1,nsample);
for k = 1:nsample
[V,D] = eig(LHS_MATRICES(:,:,k));
R_EIGENVECTORS(:,1,k) = V(:,1);
end
That code runs, but all of the eigenvector outputs are the same, and seem to be incorrect, e.g.:
val(:,:,1) =
0
1
0
0
0
0
0
0
0
0
0
val(:,:,2) =
0
1
0
0
0
0
0
0
0
0
0
The below code was perfect for determining the dominant eigenvalue for population growth rate (I am a conservation biologist). If anyone knows of something like this I could use to determine the dominant eigenvectors (and thus the stable population distribution), that would be amazing!
LHS_matrices;
EIGENVALUES = zeros(nsample,1);
for k = 1:nsample
EIGENVALUES(k,1) = max(abs(eig(LHS_MATRICES(:,:,k))));
end
  6 comentarios
David Goodmanson
David Goodmanson el 5 de Abr. de 2020
HI Jenna, Since the nth column belongs with the nth listed eigenvalue in the diagonal eigenvalue matrix, and those values can be in arbitrary order, the first column is not always dominant. It's not like the svd.
Jenna Parker
Jenna Parker el 6 de Abr. de 2020
That is extremely helpful! Thanks so much!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Linear Algebra 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!

Translated by