Effacer les filtres
Effacer les filtres

How can put eigenvalues in ascending order?

1 vue (au cours des 30 derniers jours)
Anderson
Anderson le 29 Sep 2014
Modifié(e) : Matt J le 29 Sep 2014
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.

Réponses (1)

Matt J
Matt J le 29 Sep 2014
[~,idx]=sort(diag(D));
D=D(idx,idx);
  2 commentaires
Anderson
Anderson le 29 Sep 2014
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 le 29 Sep 2014
Modifié(e) : Matt J le 29 Sep 2014
D(idx,idx) not D(idx,:)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Linear Algebra dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by