clear all
clc
f=@(t,v)9.81-(7/2125)*v^2;
t0=0;
v0=0;
tn=20;
h=2;
fprintf('\n t v ');
while t0<=tn
fprintf('\n%4.3f %4.3f ',t0,v0); %values of x and y
v1=v0+h*f(t0,v0);
t1=t0+h;
t0=t1;
v0=v1;
end
Best Answer