Info

此问题已关闭。 请重新打开它进行编辑或回答。

index exceeds the matrix

1 次查看(过去 30 天)
indhu ravi
indhu ravi 2019-3-15
关闭: MATLAB Answer Bot 2021-8-20
for i=1:length(D)
if (h_(i,T)~=D(i))
eps(T)=eps(T)+D(i,:);
end
end
  2 个评论
dpb
dpb 2019-3-15
Insufficient information...
Adam
Adam 2019-3-15
Don't use length(D) if D is a matrix, use size( D, 1 ) in that case. If the 2nd dimension of D happened to be larger than the first then this code would crash.
That may have nothing to do with your actual error, but as dpb says, you've given us next to no information to help with that apart from guessing and I only guess on a Tuesday.

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by