This preview shows page 1. Sign up to view the full content.
Unformatted text preview: x(1) = 0; % the car starts from x=0 at t=0 for i=1:n-1 % loop to perform the summation x(i+1) = x(i) + (deltat/2)*( v(i+1)-v(i) )+ deltat*v(i) ; end plot(t, x) xlabel('time') ylabel('Distance')...
View Full Document
This note was uploaded on 06/23/2011 for the course ME 218 taught by Professor Unknown during the Fall '08 term at University of Texas.
- Fall '08