| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
d = det(X)
d = det(X) returns the determinant of the square matrix X. If X contains only integer entries, the result d is also an integer.
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.
The determinant is computed from the triangular factors obtained by Gaussian elimination
[L,U] = lu(A) s = det(L) % This is always +1 or -1 det(A) = s*prod(diag(U))
The statement A = [1 2 3; 4 5 6; 7 8 9]
produces
A =
1 2 3
4 5 6
7 8 9This 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.
The arithmetic operators \, /
![]() | depfun | detrend | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |