assigning (numerical) names to multiple eigenvectors

조회 수: 4 (최근 30일)
Donald
Donald 2011년 8월 19일
Hello!
I have a a 3-d matrix (called 'newmatrix') of 28, 12x12 matrices. I am trying to get the eigenvalues and eigenvectors for all the matrices and at the end of my program have: for j = 1:28; [V,D] = eigs(newmatrix(:,:,j)) end .
The problem I'm having is that MATLAB prints out all of the eigenvalues and their respective eigenvectors consecutively, without any assigned name or number to them. I want to work with these eigenvectors (particularly those that go with the eigenvalue of 1) and think that my first step is being able to name everything. Any ideas on how I can do this?
SIDE NOTE: the matrices were originally 6x6 matrices that were made symmetrical and then weighted so that there are only real eigenvalues and that there is always an eigenvalue of 1.
  댓글 수: 2
Donald
Donald 2011년 8월 19일
Ok, after two days of pulling out my hair, I thought of the incredibly simple solution of changing [V,D] = eigs(newmatrix(:,:,j)) to [V(:,:,j),D(:,:,j)] = eigs(newmatrix(:,:,j)) right as I clicked "submit" to my post.
Thanks, anyway! I'm sure I'll be back with a question later.
Oleg Komarov
Oleg Komarov 2011년 8월 19일
Move you comment to an answer and accept it. It's legit in this case and will provide guidance for future similar questions.

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

답변 (1개)

Doug Hull
Doug Hull 2011년 8월 24일
Just putting Donald's self-answer in the correct place.
*Ok, after two days of pulling out my hair, I thought of the incredibly simple solution of changing
[V,D] = eigs(newmatrix(:,:,j))
to
[V(:,:,j),D(:,:,j)] = eigs(newmatrix(:,:,j))
right as I clicked "submit" to my post. Thanks, anyway! I'm sure I'll be back with a question later.*

카테고리

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