From the documentation of LUDecomposition
:
For an m-by-n matrix
A
with m >= n, the LU decomposition is an m-by-n unit lower triangular matrixL
, an n-by-n upper triangular matrixU
, and a permutation vectorpig
of length m so thatA(piv,:) = L*U
. If m < n, thenL
is m-by-m andU
is m-by-n.
Did you perhaps mean to find the determinant of getU()
or getL()
(one of which will be square, based on the description above)?
The det
method of LUDecomposition
returns the determinant of the matrix that was used to construct the object (in your case mtrx
, which I'm assuming isn't square).