imagesc(pher_mat)
hold on
for i=1:5000
...
end
plot(x,y)
Leaves you with the visual as described -- now it the loop is very time-consuming, nothing shows until it's done, but if you don't want the intermediates to show, then don't plot 'em...
OTOH, you could "have your plot and eat it too", if you simply updated the [X|Y]Data property each pass--
imagesc(pher_mat)
hold on
i=1;
hL=plot(x,y)
for i=2:5000
...
set(hL,'XData',x,'YData',y)
end
You can also do things like compute mod(i,10), say, and do every 10th or whatever...
"Salt to suit!" :)
Best Answer