Info

This question is closed. Reopen it to edit or answer.

somthing wrong with loop in my code

1 view (last 30 days)
benjamin ma
benjamin ma on 3 Mar 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
for i=0:length(t)
if(i>=0 && i<0.15)
disp('Steg1')
v1=velocity(v0,a,t,t0);
else
t0=0.15;
v0=v1;
a=-g;
display(a)
v2=v1;
display (v2)
while(v2>0)
t1=t0+dt;
display(t1)
v2=Velo(v0,a,t1)
end
end
i defined v2=v1, but loop starts from zero and it prints out v2 many times on the screen, what is wrong with my code?
  6 Comments
benjamin ma
benjamin ma on 3 Mar 2014
Thank you Buddy for your help, here is the zip file

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!