You can use Stateflow charts, MATLAB Function blocks, and Stateflow® Truth Tables in feedback loops in your model. You can also use these blocks with synchronous subsystems enabled by the State Control block. To prevent algebraic loop or synchronous semantic errors, apply these restrictions.
Simulink Block | Restrictions |
---|---|
Stateflow Chart | Use Moore charts to prevent an algebraic loop. In the Property
Inspector, set the State Machine Type to Moore .
Moore charts prevent algebraic loops by ensuring that outputs depend
only on current state. |
MATLAB Function block | Nondirect feedthrough semantics prevent algebraic loop errors by ensuring that outputs depend only on current state. To enable these semantics, clear the Allow direct feedthrough property check box. If your block uses direct feedthrough, do not:
When you apply these restrictions, you allow the Simulink® solver to try to solve the algebraic loop. |
Truth Table | Do not:
When you apply these restrictions, you allow the Simulink solver to try to solve the algebraic loop. |
Chart (Stateflow) | Truth Table (Stateflow)