function error while using sb2ind function
Show older comments
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. }
Accepted Answer
More Answers (2)
Walter Roberson
on 19 Jul 2011
0 votes
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
on 19 Jul 2011
0 votes
Hi,
it seems like a value in CentroidTerm(:,1) is bigger than m or a value in CentroidTerm(:,2) is bigger than n.
Categories
Find more on Elementary Math in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!