Language Reference

EIGVAL Function

EIGVAL (A) ;

This function is supported by the IML procedure and the iml action.

The EIGVAL function computes the eigenvalues of a square numeric matrix, A. The EIGVAL function returns a matrix that contains the eigenvalues of A. See the description of the EIGEN subroutine for more details.

The EIGVAL function uses vendor-supplied eigenvalue routines if they are available on your system. Use the RESET EIGEN93 statement to prevent SAS/IML from using vendor-supplied routines.

The following statements compute Example 7.1.1 from Golub and Van Loan (1989):

A = {  67.00  177.60  -63.20 ,
      -20.40   95.88  -87.16 ,
       22.80   67.84   12.12 };
val = eigval(A);
print val;

Figure 138: Eigenvalues

val
75100
75-100
250


Notice that the matrix a is not symmetric and that the eigenvalues are complex. The first column of the val matrix is the real part of the three eigenvalues, and the second column is the complex part.

If a matrix is symmetric, it has real eigenvalues and real eigenvectors. The following statements produce a column vector that contains the eigenvalues of a crossproducts matrix:

A = {4 10, 10 30};     /* A is a symmetric matrix */
rval = eigval(A);
print rval;

Figure 139: Real Eigenvalues of a Symmetric Matrix

rval
33.401219
0.5987805


Last updated: July 20, 2026