Error using sub2ind and error in imline/createMask ?
Afficher commentaires plus anciens
Hi, while working with the below script I keep getting error message: Error using sub2ind (line 52) Out of range subscript. Error in imline/createMask (line 171) ind = sub2ind([m n], y, x); please can anyone help me with these error messages
Réponse acceptée
Plus de réponses (1)
Guillaume
le 21 Juil 2015
0 votes
The error message is indeed not very helpful, but the error is simply due to the fact that one or both endpoints of your line generated by imline are outside the boundaries of the image.
But first, fix the indenting of your file (right-click in the editor and select smart indent or just press CTRL+I). Once you've done that it'll be fairly obvious that your hline = imline(... and subsequent lines should be inside the for nn = ... loop. (or you've got a major conceptual failure in your code as, as it is, only the x1, x2, index1, etc. of the last iteration of the three loop will be used).
1 commentaire
peyush
le 21 Juil 2015
Catégories
En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!