MATLAB: Temporal logic in condition

stateflowtemporal logic

Hello,
I have some temporal conditions in system logic, for example:
if (a>10 for 10 sec)
then doSomething
else
returnToParentState
I implemented this using additional "detected" states, but this solution looks weird and unclear. (See picture below).
May be there is another way to do this?

Best Answer

Try with a junction. You need that junction because a trigger can only be stated before the condition in one transition.