sub2ind -> out of range subscript
Ältere Kommentare anzeigen
Hi ! I am a student and my project is about fingerprint analysis and minutia recognition. First, I have to understand each lines of the program sent by Florence Kussener : http://www.mathworks.com/matlabcentral/fileexchange/16728-fingerprint-application This application works great with the joined picture but when I download a new one, the program crashes with this error :
??? Error using ==> sub2ind at 58 Out of range subscript.
Do you have an idea ? The botch pictures are square and gray scale...I don't find the problem
Regards
PS : I am French and I my English is poor, sorry for that. And if you can answer me, please, I have to understand you so use a basic English
Akzeptierte Antwort
Weitere Antworten (2)
Matt Fig
am 24 Mär. 2011
The error means exactly what it says. Here is an example where we try to access element (4,6) in a 3-by-3 matrix. It should produce the same error you experienced.
sub2ind([3,3],4,6)
Now as to why the program gets this error, it is hard to say. Perhaps the author hard-coded the conversion in and so when a new array is used that is smaller than the coding allows, the function errors.
2 Kommentare
Walter Roberson
am 24 Mär. 2011
The first argument to sub2ind() needs to be the array size, not the array itself...
Matt Fig
am 24 Mär. 2011
Thanks, Walter! I don't know how I missed that one, though it did give the 'correct' error for what I was doing...
Jean-Edouard Simonin
am 25 Mär. 2011
0 Stimmen
Kategorien
Mehr zu Numeric Types finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!