det

Determinant of symbolic matrix

Description

example

B = det(A) returns the determinant of the square matrix A.

example

B = det(A,'Algorithm','minor-expansion') uses the minor expansion algorithm to evaluate the determinant of A.

Examples

collapse all

Compute the determinant of a symbolic matrix.

syms a b c d
M = [a b; c d];
B = det(M)
B = ad-bc

Compute the determinant of a matrix that contain symbolic numbers.

A = sym([2/3 1/3; 1 1]);
B = det(A)
B = 

13

Create a symbolic matrix that contains polynomial entries.

syms a x 
A = [1, a*x^2+x, x;
     0, a*x, 2;
     3*x+2, a*x^2-1, 0]
A = 

(1ax2+xx0ax23x+2ax2-10)

Compute the determinant of the matrix using minor expansion.

B = det(A,'Algorithm','minor-expansion')
B = 3ax3+6x2+4x+2

Input Arguments

collapse all

Input, specified as a square numeric or symbolic matrix.

Tips

  • Matrix computations involving many symbolic variables can be slow. To increase the computational speed, reduce the number of symbolic variables by substituting the given values for some variables.

  • The minor expansion method is generally useful to evaluate the determinant of a matrix that contains many symbolic variables. This method is often suited to matrices that contain polynomial entries with multivariate coefficients.

References

[1] Khovanova, T. and Z. Scully. "Efficient Calculation of Determinants of Symbolic Matrices with Many Variables." arXiv preprint arXiv:1304.4691 (2013).

See Also

|

Introduced before R2006a