From: John Rossy on
Hello!

Can somebody tell me where is the problme in the following code (timestep cant be increased). Thanx in advance!

clear
%function falling_apple
g= 9.81;
h(1,1)=10;
v(1,1)=10;
timestep=0.01;
index=1;

while (h(index)>0)
v(index+1,1)=v(index,1)-g*timestep;
h(index+1,1)=h(index,1)-v(index,1)*timestep;
index=index+1;
end

figure(1);
plot(v);
xlabel('timestep');
ylabel ('v[m/s]');

figure(2);
plot(h);
xlabel('timesptep');
xlabel('h[m]');

return
From: Matt Fig on
You must be in the same class as Paso Sivro. Maybe you two can get together and figure it out....