Calculating dominant eigenvector for each matrix in a large array

조회 수: 10 (최근 30일)
Jenna Parker
Jenna Parker 2020년 4월 3일
댓글: Jenna Parker 2020년 4월 6일
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.
Jenna Parker
Jenna Parker 2020년 4월 6일
That is extremely helpful! Thanks so much!

댓글을 달려면 로그인하십시오.

답변 (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