From: Paso Sivro on 21 May 2010 20:40 Hello can somebody please tell me what is wrong with the following code(timestep cannot 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
|
Pages: 1 Prev: Matlab assistance on variable names Next: Problem with code |