Calculating dominant eigenvector for each matrix in a large array

7 views (last 30 days)
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 Comments
David Goodmanson
David Goodmanson on 5 Apr 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.

Sign in to comment.

Answers (0)

Categories

Find more on Linear Algebra in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!