필터 지우기
필터 지우기

How can put eigenvalues in ascending order?

조회 수: 1 (최근 30일)
Anderson
Anderson 2014년 9월 29일
편집: Matt J 2014년 9월 29일
Hi,
I am using something like [V,D] = eig(S) and I would like the eigenvalues in ascending order in the diagonal. V, D and S are 2x2 matrices.
Thanks.

답변 (1개)

Matt J
Matt J 2014년 9월 29일
[~,idx]=sort(diag(D));
D=D(idx,idx);
  댓글 수: 2
Anderson
Anderson 2014년 9월 29일
Thank you for your reply.
I tried this but I got the eigenvalues not in the diagonal. Is it right?
Dt1 =
0 -0.5782
0.6702 0
Matt J
Matt J 2014년 9월 29일
편집: Matt J 2014년 9월 29일
D(idx,idx) not D(idx,:)

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

카테고리

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