EIGVAL Function

EIGVAL (A) ;

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;

Figure 23.105: Eigenvalues

val
75 100
75 -100
25 0


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 = x` * x;            /* xpx is a symmetric matrix */
rval = eigval(xpx);   
print rval;

Figure 23.106: Real Eigenvalues of a Symmetric Matrix

rval
33.401219
0.5987805