Calculating dominant eigenvector for each matrix in a large array

10 次查看(过去 30 天)
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 个评论
David Goodmanson
David Goodmanson 2020-4-5
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.

请先登录,再进行评论。

回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by