Question

I am using the SUBPLOT function in MATLAB to display some 8 images. The processing on the images take time, and I want the images to be shown in the subplot as and when they are generated.

But what happens is that the subplot comes up after the script finishes, and not during the execution. What is to be done to obtain this?

Here is how I am using the subplot calls.

subplot(2,4,1),subimage(I),title('image1');
//some processing
subplot(2,4,2),subimage(I),title('image2');
//some processing
subplot(2,4,3),subimage(I),title('image3');
//some processing
subplot(2,4,4),subimage(I),title('image4');
//some processing
subplot(2,4,5),subimage(I),title('image5');
//some processing
subplot(2,4,6),subimage(I),title('image6');
//some processing
subplot(2,4,7),subimage(I),title('image7');
//some processing
subplot(2,4,8),subimage(I),title('image8');
//subplot shows up now, why?
Was it helpful?

Solution

You could try using the drawnow command after each subplot.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top