Effacer les filtres
Effacer les filtres

Eigenvalus and Eigenvectors, Forming matrices

2 vues (au cours des 30 derniers jours)
mohammed abdul wadood
mohammed abdul wadood le 26 Mar 2018
hi, if i have Eigenvalues and Eigenvectors matrices calculated from covariance matrix (A), how can i formed new matrix (H) that the first row for it is the eigenvector that corresponding to the largest eigenvalue, and similarly for the rest of rows.
H=[e1'; e2'; ... ;en']
thanks.
  4 commentaires
John D'Errico
John D'Errico le 26 Mar 2018
Sort returns TWO outputs.
you can use sort to sort a vector. Then take the second argument from sort to sort a second array or vector. This is what birdman did for you in his answer.
mohammed abdul wadood
mohammed abdul wadood le 26 Mar 2018
thanks sir, thank you for your helping

Connectez-vous pour commenter.

Réponse acceptée

Birdman
Birdman le 26 Mar 2018
One approach:
A=[2 4;5 1]
[V,D,~]=eig(A)
[~,idx]=sort(D(D~=0),'descend')
V(idx,:)=V.' %corresponds to your desired H matrix
  1 commentaire
mohammed abdul wadood
mohammed abdul wadood le 26 Mar 2018
thanks Birdman it's work perfectly

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Eigenvalues & Eigenvectors 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