How to skip command lines inside the loop
1 回表示 (過去 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!