For visual verification of my algorithm as I develop it, I have been using imshow to display representations of my data and at one point I overlay 2 images from arrays in a for loop, with reduced transperancy so I can see both. I have been using the following and it has been working fine (virtually an animation is displayed as the loop progresses):
for k = 1:length(maskedArray)
However, I have changed my workflow so that I now import a single image and process it through each iteration of a loop, so I can handle huge numbers of images. At the end of the loop, if I use imshow() for a single image, I still get the expected 'animation' as the loop runs through each iteration.
The problem is, as soon as I use 'hold on' as i have above, or even with the single image, I don't get any images at all displayed until the final loop iteration.
So code such as:
generates a 'slideshow' animation just fine, but code such as:
will only show the final image in the sequence.
I don't understand why the 'hold' command supresses the imshow until the final loop iteration but work fine when I use an array of images? Is there a way around this or do I have to revert to smaller data sets and generating image arrays?