MATLAB Functions Help Desk

det

Purpose

Matrix determinant

Syntax

Description

d = det(X) returns the determinant of the square matrix X. If X contains only integer entries, the result d is also an integer.

Remarks

Using det(X) == 0 as a test for matrix singularity is appropriate only for matrices of modest order with small integer entries. Testing singularity using abs(det(X)) <= tolerance is not recommended as it is difficult to choose the correct tolerance. The function cond(X) can check for singular and nearly singular matrices.

Algorithm

The determinant is computed from the triangular factors obtained by Gaussian elimination

Examples

The statement A = [1 2 3; 4 5 6; 7 8 9]

produces

This happens to be a singular matrix, so d = det(A) produces d = 0. Changing A(3,3) with A(3,3) = 0 turns A into a nonsingular matrix. Now d = det(A) produces d = 27.

See Also

\           Matrix left division (backslash)

/           Matrix right division (slash)

cond        Condition number with respect to inversion

condest     1-norm matrix condition number estimate

inv         Matrix inverse

lu          LU matrix factorization

rref        Reduced row echelon form



[ Previous | Help Desk | Next ]