EIG EIG Eigendecomposition of a Matrix Usage Computes the eigendecomposition of a square matrix. The eig function has several forms. The first returns only the eigenvalues of the matrix: s = eig(A) The second form returns both the eigenvectors and eigenvalues as two matrices (the eigenvalues are stored in a diagonal matrix): [V,D] = eig(A) where D is the diagonal matrix of eigenvalues, and V is the matrix of eigenvectors. Eigenvalues and eigenvectors for asymmetric matrices A normally are computed with balancing applied. Balancing is a scaling step that normaly improves the quality of the eigenvalues and eigenvectors. In some instances (see the Function Internals section for more details) it is necessary to disable balancing. For these cases, two additional forms of eig are available: s = eig(A,'nobalance'), which computes the eigenvalues of A only, and does not balance the matrix prior to computation. Similarly, [V,D] = eig(A,'nobalance') recovers both the eigenvectors and eigenvalues of A without balancing. Note that the 'nobalance' option has no affect on symmetric matrices. FreeMat also provides the ability to calculate generalized eigenvalues and eigenvectors. Similarly to the regular case, there are two forms for eig when computing generalized eigenvector (see the Function Internals section for a description of what a generalized eigenvector is). The first returns only the generalized eigenvalues of the matrix pair A,B s = eig(A,B) The second form also computes the generalized eigenvectors, and is accessible via [V,D] = eig(A,B)