How to Find the Determinant of a Matrix in MATLAB using for loop. i don't want to use the actual code.
5 次查看(过去 30 天)
显示 更早的评论
How to Find the Determinant of a Matrix in MATLAB using for loop. i don't want to use the actual code.thanks
采纳的回答
Walter Roberson
2021-10-10
编辑:Walter Roberson
2021-10-10
if isscalar(YourArray) || isempty(YourArray)
total = YourArray;
else
total = 0;
for R = 1 : number_of_rows
for C = 1 : number_of_columns
total = total + SomeValue * YourArray(R,C) * YourDeterminentFunction(YourArray with Row #R and Column #C crossed out)
end
end
end
SomeValue is +1 or -1 but you need to figure out which.
2 个评论
Walter Roberson
2021-10-10
Use a recursive function.
z(i,j)
Determinents and cofactors are scalar. What is your reasoning for storing something there?
(There are reasons to want to store items as you go through, but I suspect your thoughts are about something else completely.)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!