Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

## Compute Eigenvalues and Eigenvectors Numerically

When computing eigenvalues and eigenvectors of some matrices symbolically, you can get a long result in a form that is not suitable for further computations. For example, the linalg::eigenvectors function returns the following results for eigenvalues and eigenvectors of the 3 ×3 Hilbert matrix:

```H := linalg::hilbert(3):
eigen := linalg::eigenvectors(H)```

Numeric approximation of the result returned by the symbolic linalg::eigenvectors function gives a shorter answer that contains complex numbers:

`float(eigen)`

If you need simple (though approximate) eigenvalues and eigenvectors of the Hilbert matrix in further computations, use numeric methods from the beginning. To approximate eigenvalues and eigenvectors of a matrix numerically, use the numeric::eigenvectors function. The function returns eigenvalues, eigenvectors, and residues (estimated errors for the numerical eigenvalues):

`[eigenvalues, eigenvectors, residues] := numeric::eigenvectors(H)`

Small residue values indicate that roundoff errors do not significantly affect the results. To suppress the computation of the residues, use the NoResidues option:

`numeric::eigenvectors(H, NoResidues)`

If you want to compute only eigenvalues of a matrix, use the numeric::eigenvalues function:

`numeric::eigenvalues(H)`

When computing eigenvalues and eigenvectors numerically, you can use the HardwareFloats and SoftwareFloats options to employ hardware or software float arithmetic, respectively. For information about these options, see the Numeric Determinant section. For more details, see the numeric::eigenvectors and numeric::eigenvalues help pages.