Compute the eigenvalues of a square 2-by-2 matrix.
scidemo_matrixeigshow (A)
a 2-by-2 real matrix of doubles
This function makes use of the spec function to compute the eigenvalues and eigenvectors of a square 2-by-2 matrix.
This function first plot the unit cercle, using the equations
Then, we plot the points b from the equation
The current function is a demonstration of the following functions.
The eigenvalues lambda and eigenvectors x are satisfying the equation:
The spec function has the calling sequence
[R,D]=spec(A) | ![]() | ![]() |
which decomposes the matrix A as
where D is the diagonal matrix of eigenvalues and R is the column-by-column matrix of right eigenvectors.
The two rays in the plot are corresponding to the two eigenvectors.
It may happen that the two eigenvectors are not the major and minor axes of the ellipse. If the matrix is symmetric, the two eigenvectors are the major and minor axes.
"Numerical Computing with Matlab", Cleve Moler, 2004, Chapter 10. Eigenvalues and Singular Values