Info

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

Problem in the for loop

1 回表示 (過去 30 日間)
Aiman Achergui
Aiman Achergui 2020 年 11 月 29 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello,
I have a problem with my for loop, it does just compute the values for the first step, it doesn't continue to compute the other steps, it's just like staying in the first step. You will find attached the programm, if anyone can help I would be very grateful
Kind regards,

回答 (1 件)

Rik
Rik 2020 年 11 月 29 日
You are using a syntax that only works on Octave, not Matlab.
You don't reset your error at the start of every iteration, so your while loop exits immediately for the later iterations.
  3 件のコメント
Aiman Achergui
Aiman Achergui 2020 年 11 月 29 日
Yes Iam using Octave. But what do you mean by I don't reset my error.
Rik
Rik 2020 年 11 月 29 日
Your while look uses a condition. That condition needs to be false for the loop to exit. Then you continue to a new value of t. Neither part of the condition has changed, so it is still false, meaning the loop does not execute.

Community Treasure Hunt

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

Start Hunting!

Translated by