which method is usied to solve the Determinant in Matlab

4 次查看(过去 30 天)
Hi,
Does Matlab use the LU decomposition or the Laplace expansion to calculate the determinant of a Matrix?
best Regards.

回答(1 个)

John D'Errico
John D'Errico 2023-11-14
编辑:John D'Errico 2023-11-14
JUST READ THE HELP! (Actually, doc det.) In there, you will see this statement:
det computes the determinant from the triangular factors obtained by Gaussian elimination with the lu function.
[L,U] = lu(X)
s = det(L) % This is always +1 or -1
det(X) = s*prod(diag(U))
Seriously, almost always just reading the docs for a function will give you at least some clue as to how they are written. (Not always.) But at least they will usually give you a reference, and for basic codes, they will give you a good idea of how they are written.
Sometimes, you can even look at the code itself. In that case, do this:
type det
'det' is a built-in function.
Here, it will tell you only that det is a compiled code, but at least you can look.

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by