Index exceeds matrix dimensions det
2 次查看(过去 30 天)
显示 更早的评论
D is matrix right? why det(D) not work someone help me
0 个评论
回答(2 个)
Jan
2017-12-14
编辑:Jan
2017-12-14
You have provided very few information, such that the readers have to guess. My idea:
You have defined "det" as a variable before:
X = randi([1, 100], [3, 3]);
det(X);
...
det = ones(2, 2);
det(X) % Indices out of range
Check this by typing into the command window:
dbstop if error
Then run the code again and when it stops, check what "det" is:
which det -all
If this is the problem, the solution is easy: Do not shadow built-in functions by local variables.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!