Created
September 19, 2021 22:29
-
-
Save ejdanderson/772d4241b2297ef710cbc8394a388954 to your computer and use it in GitHub Desktop.
Sort via descending order for eig in MATLAB (real values)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[V, D] = eig(A); | |
[nuDiag,order] = sort(diag(D),'descend'); | |
D = diag(nuDiag); | |
V=V(:,order); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment