resolving the error Subscript indices must either be real positive integers or logicals when using squeeze function
Mostrar comentarios más antiguos
I am new to matlab.I am using it interactively select pixels from an image.I am using imagesc to display my image,ginput to select a pixel and retrieve its coordinate values.but i am getting an error in this line of code-
p1=squeeze(I(y,x,:));
I am using envihdrread to read the header info and envidataread to read the image data.And then i am using the following code:
s =I(:,:,80); imagesc(s) [x y]=ginput p1=squeeze(I(y,x,:));
This is giving me an error:-
Subscript indices must either be real positive integers or logicals
please help me to sort it out.
Thank you!!!!!!!
Ekta Shah
Respuestas (1)
Walter Roberson
el 17 de Mzo. de 2012
0 votos
ginput() returns data units, not necessarily integer coordinates.
Another consideration is that for image() and imagesc(), positions are measured by the center of the pixels.
Categorías
Más información sobre Aerospace Blockset en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!