Eigenvalus and Eigenvectors, Forming matrices

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 件のコメント

John D'Errico
John D'Errico 2018 年 3 月 26 日
Have you not shown exactly that? You show how to create H.
You don't know how to sort them, maybe?
Just create the matrix, than sort your eigenvalues. Now use the results from the sort (READ THE HELP FOR SORT) to sort the rows of your matrix in corresponding order.
mohammed abdul wadood
mohammed abdul wadood 2018 年 3 月 26 日
編集済み: mohammed abdul wadood 2018 年 3 月 26 日
you mean if the Eigen values matrix is (V), and the Eigen vectors matrix is (M), we can just sort the (M) matrix and we get the (H) matrix
[M V]=eig(c) H=(rot90(M))'
thank you sir, actually I'm just a beginner in matlab so i don't have many idea, your answers help my a lot, thanks.
John D'Errico
John D'Errico 2018 年 3 月 26 日
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 2018 年 3 月 26 日
thanks sir, thank you for your helping

サインインしてコメントする。

 採用された回答

Birdman
Birdman 2018 年 3 月 26 日

0 投票

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 件のコメント

mohammed abdul wadood
mohammed abdul wadood 2018 年 3 月 26 日
thanks Birdman it's work perfectly

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by