Created
March 4, 2015 08:59
-
-
Save shaybensasson/8c06eb412bf987d141ee to your computer and use it in GitHub Desktop.
get sorted eigvals and eigvects
This file contains 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
%A=[5,8,16;4,1,8;-4,-4,-11]; %real eigvects | |
%http://math.mit.edu/~gs/linearalgebra/ila0601.pdf | |
A=[.8,.3;.2,.7]; | |
[V,D] = eig(A); | |
[evals,idx] = sort(diag(D)); | |
EigenValues = evals | |
evects = V(:,idx); | |
EigenVects = evects | |
%{ | |
EigenValues = | |
0.5 | |
1 | |
EigenVects = | |
-0.70711 0.83205 | |
0.70711 0.5547 | |
%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment