MATLAB: Eigenvalus and Eigenvectors, Forming matrices

eigenvaluseigenvectorsmatrices

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.

Best Answer

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