<< scidemo_edolinear Demonstration Toolbox scidemo_normaldist >>

Demonstration Toolbox >> Demonstration Toolbox > scidemo_matrixeigshow

scidemo_matrixeigshow

Compute the eigenvalues of a square 2-by-2 matrix.

Calling Sequence

scidemo_matrixeigshow (A)

Parameters

A :

a 2-by-2 real matrix of doubles

Description

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.

Examples

A = [1 2;3 4];
[R,D]=spec(A)
h = scf();
scidemo_matrixeigshow (A);

Authors

Bibliography

"Numerical Computing with Matlab", Cleve Moler, 2004, Chapter 10. Eigenvalues and Singular Values

<< scidemo_edolinear Demonstration Toolbox scidemo_normaldist >>