I'm trying to retrieve the pixel location of the pixel that meets the following criterion:
if s >= maximum
maximum = s;
pixel_location = sub2ind(size(p),i,j);
It seems that on the first run for instance, the criterion was not met, and thus, the "pixel_location" value was not returned. Thus, I got the following error:
Output argument "pixel_location" (and maybe others) not assigned during call to ...
In this case, what can I add in order to make the for-loop I'm running to continue without returning any value in this case. For instance, I tried adding an "else" and assigning some location (i.e; (1,1)). But, this may affect the output, wouldn't it?