If [A] is an N×N matrix, then the roots of det([A]-X identity(N)) are the eigenvalues of [A].
For 2×2 matrices, the determinant is simply
For larger matrices, the determinant can be computed using the [wikipedia:Laplace_expansion Laplace expansion], which allows you to express the determinant of an n×n matrix in terms of the determinants of (n-1)×(n-1) matrices. However, since the Laplace expansion takes operations, the method usually used in calculators is Gaussian elimination, which only needs operations.
The matrix is first decomposed into a unit lower-triangular matrix and an upper-triangular matrix using elementary row operations:
The determinant is then calculated as the product of the diagonal elements of the upper-triangular matrix.
- ERR:INVALID DIM is thrown when the matrix is not square.