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.
0 个评论
回答(1 个)
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
Here, it will tell you only that det is a compiled code, but at least you can look.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mathematics and Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!