How to skip command lines inside the loop
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a big while loop in some part of my project. Inside this loop, there are many operations going on and the results are checked for the convergency in the end. If the result is convergent, the loop ends but if it is non-convergent, I need to change the parameter and go back to the beginning of the loop again.
Here comes my question : I have 5 parameters to modify and all of the parameters should be checked in order. For example first parameter is STALLH Y and I would like to make it STALLH N if the result is non convergent and go to the beginning of the loop. When I evaluate the result again, I would like to modify the 2nd parameter IDLEPITCH 90 to IDLEPITCH 91. This will be like that until the end of the 5th parameter. But everytime I come to the parameter modification part, the code will check the previous parameters again which I dont want. Is there any suggestion for skipping some lines in command order according to the conditional cases?
댓글 수: 0
답변 (1개)
Adam Filion
2012년 6월 29일
You can use either an if/else or switch/case structure to conditionally execute sections of code. The examples section in their documentation pages below is a good place to get started with them.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!