MATLAB: How to break out of a FOR loop when using the FOR Iterator block in Simulink

simulink

I would like to break out of a FOR loop using the FOR Iterator block.

Best Answer

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.