numeric
::det
Determinant of a matrix
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
numeric::det(A
, <mode
>, <MinorExpansion>, <NoWarning>)
numeric::det(A)
returns the determinant
of the matrix A.
Without the option Symbolic
, all entries
of A
must be numerical. Numerical expressions such
as , etc.
are accepted and converted to floats. If symbolic entries are found
in the matrix, numeric::det
automatically switches
to Symbolic
issuing a warning.
The option Symbolic
should be used if the
matrix contains symbolic objects that cannot be converted to floating
point numbers.
Matrices A
of a matrix domain such as Dom::Matrix(...)
or Dom::SquareMatrix(...)
are
internally converted to arrays over expressions via expr(A)
.
Note that det
must
be used, when the determinant is to be computed over the component
domain. See Example 2. Note
that the option Symbolic
should be used if the
entries cannot be converted to numerical expressions.
Without the option Symbolic
, the function
is sensitive to the environment variable DIGITS
, which determines
the numerical working precision.
Numerical matrices can be processed with or without the option Symbolic
:
A := array(1..3, 1..3,[[1, 1, I], [1, exp(1), I], [1, 2, 2]]): numeric::det(A), numeric::det(A, Symbolic)
The option Symbolic
must be used when the
matrix has nonnumerical entries:
A := array(1..2, 1..2, [[1/(x + 1), 1], [1/(x + 2), PI]]): numeric::det(A, Symbolic)
If the option MinorExpansion
is used, symbolic
entries are accepted, even if the option Symbolic
is
not specified:
detN := numeric::det(A, MinorExpansion); detS := numeric::det(A, Symbolic, MinorExpansion)
Simplify these results using Simplify
:
Simplify(detN), Simplify(detS)
delete A:
The following matrix has domain components:
A := Dom::Matrix(Dom::IntegerMod(7))([[6, 1], [1, 6]])
Note that numeric::det
computes the determinant
of the following matrix:
expr(A), numeric::det(A)
det
must
be used, if the determinant is to be computed over the component domain Dom::IntegerMod
(7)
:
det(A)
delete A:
We demonstrate the use of hardware floats. Hilbert
matrices are notoriously illconditioned: the computation of
the determinant is subject to severe cancellation effects. The following
results, both with HardwareFloats
as well as with SoftwareFloats
,
are marred by numerical roundoff:
A := linalg::hilbert(15): float(numeric::det(A, Symbolic)), numeric::det(A, HardwareFloats), numeric::det(A, SoftwareFloats)
delete A:

A square matrix of domain type 

One of the flags 

With With Compared to the If no If the result cannot be computed with hardware floats, software arithmetic by the MuPAD kernel is tried. If the current value of There may be several reasons for hardware arithmetic to fail:
If neither If Note that The trailing digits in floatingpoint results computed with NoteFor ill conditioned matrices the results returned with 

This option prevents conversion of the input data to floats.
With this option, symbolic entries are accepted. It overrides the
option NoteThis option should not be used for floatingpoint matrices!
The 

With this option, recursive minor expansion along the columns is used. This option may be useful for small matrices with symbolic entries. This option implies With this option, symbolic entries are accepted even if the
option 

Suppresses warnings 
By default, the determinant is returned as a floatingpoint
number. With the option Symbolic
, an expression
is returned.
Without the option Symbolic
, QRfactorization
of A via
Householder transformations is used.
With Symbolic
, LUfactorization
of A is
used.