MATLAB - Determinant of a Matrix



Determinant of a matrix is calculated using the det function of MATLAB. Determinant of a matrix A is given by det(A).

Example

Create a script file with the following code −

a = [ 1 2 3; 2 3 4; 1 2 5]
det(a)

When you run the file, it displays the following result −

a =
      1     2     3
      2     3     4
      1     2     5
ans = -2
matlab_matrics.htm
Advertisements