Language Reference |
EIGVAL Function |
The EIGVAL function computes the eigenvalues of a square numeric matrix, A. The EIGVAL function returns a column vector that contains the eigenvalues of A. See the description of the EIGEN subroutine for more details.
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;
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 the eigenvalues of a crossproducts matrix:
x = {1 1, 1 2, 1 3, 1 4}; xpx = t(x) * x; /* xpx is a symmetric matrix */ rval = eigval(xpx); print rval;
Copyright © SAS Institute, Inc. All Rights Reserved.