function error while using sb2ind function
显示 更早的评论
there is an errror in sub2ind function when i type the following: indTerm=sub2ind([m,n],CentroidTerm(:,1),CentroidTerm(:,2));
it says that "out of range subscript"
plz tell me what is the problem. }
采纳的回答
更多回答(2 个)
Walter Roberson
2011-7-19
0 个投票
Is any member of CentroidTerm(:,1) less than 1 or greater than m? Is any member of CentroidTerm(:,2) less than 1 or greater than n? Is it possible that you have accidentally created a variable named "sub2ind" ?
Friedrich
2011-7-19
0 个投票
Hi,
it seems like a value in CentroidTerm(:,1) is bigger than m or a value in CentroidTerm(:,2) is bigger than n.
类别
在 帮助中心 和 File Exchange 中查找有关 Elementary Math 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!