Skip to content

det

Determinant of a square matrix.

b = det(A)

Returns the determinant of the square matrix A. Computed via LU decomposition rather than direct expansion, so it’s stable and reasonably fast for moderately-sized matrices.

Watch for overflow / underflow with large matrices: when det(A) is extremely large or small, the value isn’t reliable and you should use log(abs(det(A))) or related quantities instead.

det([1 2; 3 4]) % -2
det(magic(3)) % -360
det(eye(5)) % 1
  • inv — Matrix inverse.
  • rank — Numerical rank of a matrix.
  • trace — Sum of diagonal elements.