The inner for-loop overwrites va one hundred times. The outer for-loop draws the "same" image one hundred times in the same place.
In plain English, what do you want to show in the second plot?
 
 
Replace
by
subplot(2, 1, 2)
plot( 0, r, 'r.' );
axh = gca;
set( axh, 'XLim', [0,1e3] )
hold all
for t = 1:6
displacement = V*t;
plot( axh, displacement, r, 'r.' );
pause( 1 )
end
and run the script. That will take you a bit closer to the goal.
Best Answer