I have N eigenvalues in column vector form.
Thus there are N eigenvectors corresponding to these eigenvalues, forming an eigenvector matrix.
Now, the problem I am working on requires me to sort the eigenvalues column vector in descending order. How do I sort the eigenvectors matrix in the same order as their eigenvalues in order to preserve correspondence?
For example,
or if you want them in the same form, replace the last line by
EDIT: while I used
{evals,evecs}=Eigensystem[m], that’s not necessary. I could just have useds=Eigensystem[m]and then usedswherever I currently have{evals,evecs}.