pBook‎ > ‎Matlab‎ > ‎

Drawnow

posted Aug 29, 2014, 3:38 AM by Javad Taghia   [ updated Aug 29, 2014, 3:38 AM ]
We are going to use Matlab plotting capability to produce animation while we are simulating.
The essential command is "drawnow" and we can "pause" to slow down the animation.

for i=1:1:length(y)
    plot (y(i,1),y(i,2), '*r')
    hold on
    grid on
    axis equal
  
    plot (y(i,4),y(i,5), '*b')
    drawnow
    pause(0.1)
end
Comments