Info

この質問は閉じられています。 編集または回答するには再度開いてください。

somthing wrong with loop in my code

1 回表示 (過去 30 日間)
benjamin ma
benjamin ma 2014 年 3 月 3 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 件のコメント
Image Analyst
Image Analyst 2014 年 3 月 3 日
Like I said, we don't know what t is so we don't know what length(t) is, and this is required before the loop can start. Plus, why didn't you attach Velo and velocity even after I said that is what is lacking for us to help you debug this?
benjamin ma
benjamin ma 2014 年 3 月 3 日
Thank you Buddy for your help, here is the zip file

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by