Functions > Vector and Matrix > Array Characteristics > Example: Eigenvectors and Eigenvalues
Example: Eigenvectors and Eigenvalues
Use the eigenvals, eigenvecs, and eigenvec functions to find the eigenvalues and the eigenvectors of a real or complex matrix. Check the theory that for a square matrix M, a nonzero vector v is an eigenvector of M if you can find a number λ such that:
1. Define an input square matrix.
2. Call eigenvals and eigenvecs to find the eigenvalues and the eigenvectors of matrix A.
The first column of v is the eigenvector corresponding to the first element of c. Similarly, the second column of v is the eigenvector corresponding to the second element of c, and so on.
3. Define v1 to be the first eigenvector and c1 to be the first eigenvalue of A. Compare A x v1 to c1 x v1.
 A v1 c1 v1
4. Define v2 to be the first eigenvector and c2 to be the first eigenvalue of A. Compare A x v2 to c2 x v2.
 A v2 c2 v2
5. Define v3 to be the first eigenvector and c3 to be the first eigenvalue of A. Compare A x v3 to c3 x v3.
 A v3 c3 v3
6. Call the eigenvec function to return a single eigenvector for a particular eigenvalue.
The results returned by eigenvec and eigenvecs do not necessarily match, yet they are both valid solutions. An eigenvector is not unique. It is related to other eigenvectors by a scale factor. For a given eigenvalue, there is an infinite number of eigenvectors.