Problem in the for loop

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일

0 개 추천

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

Image Analyst
Image Analyst 2020년 11월 29일
Best solution is to switch to MATLAB. But which for loop or while loop or statement is considered to be "the first step"? There are several loops and numerous statements.
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.

이 질문은 마감되었습니다.

질문:

2020년 11월 29일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by