MATLAB: How to solve an algebraic loop error

algebraicloopstateflow

I have this system. There is a stateflow block in Joystik and a "i = i+1" code in dotSelection. I reseive tkis error:
"Cannot solve algebraic loop involving 'Lorien/dotSelection' because it consists of blocks that cannot be assigned algebraic variables, such as blocks with discrete-valued outputs, blocks with non-double or complex outputs, Stateflow blocks, or nonvirtual subsystems. Consider breaking the algebraic loop. For example, add a delay or a memory block to the loop.
Algebraic loop error with 'Lorien/Joystik /Chart'
Algebraic loop error with 'Lorien/dotSelection'"
Can I solve it?

Best Answer

As Simulink says it to you : just add a delay to break the algebraic loop.