Error using sub2ind and error in imline/createMask ?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Guillaume
el 21 de Jul. de 2015
0 votos
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 comentario
peyush
el 21 de Jul. de 2015
Categorías
Más información sobre Convert Image Type en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!