To compute the eigenvalues of a square matrix in MATLAB, you can use the eig function. Here's an example:
main.m68 chars6 lines
This will output an array of the eigenvalues of the matrix A. If you would like to get both eigenvalues and eigenvectors, you can use two output arguments:
main.m94 chars6 lines
Here, V will contain the eigenvectors and D will be a diagonal matrix containing the eigenvalues on its diagonal.
gistlibby LogSnag