drawnow
Forces an update of the current axes.
Syntax
drawnow()
Example
Simple drawnow example:
figure;
t = linspace(0,2*pi,100);
for i=1:100
  plot(t,sin(t+i/100));
  drawnow
end
    Comments
drawnow must be used if plots are created or changed in a loop. If drawnow is omitted in a loop, the plot will be updated once after the loop finishes execution.