How do I break out of a FOR loop when using the FOR Iterator block in Simulink?
6 views (last 30 days)
Show older comments
MathWorks Support Team
on 27 Jun 2009
Commented: Robert
on 19 Mar 2020
I would like to break out of a FOR loop using the FOR Iterator block.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
The ability to break out of a FOR loop when using the FOR Iterator block is not available in Simulink.
As a workaround, use the attached example. This model stores the state of the FOR Iterator and breaks out of it when a condition is satisfied.
2 Comments
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!