Skip to content

Instantly share code, notes, and snippets.

@ejdanderson
Created September 19, 2021 22:29
Show Gist options
  • Save ejdanderson/772d4241b2297ef710cbc8394a388954 to your computer and use it in GitHub Desktop.
Save ejdanderson/772d4241b2297ef710cbc8394a388954 to your computer and use it in GitHub Desktop.
Sort via descending order for eig in MATLAB (real values)
[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