Time during which condition is valid
duration( returns the number of
seconds since the conditional expression
true and the associated state became active.
The temporal logic operator
duration is not supported in
standalone charts in MATLAB®.
Transition out of the state when the variable
x has been greater than or equal to 0 for longer than 0.1
[duration(x>=0) > 0.1]
Store the number of seconds since the variable
x became greater than 5.
en,du: y = duration(x>5);
The Stateflow® chart resets the value of the
if the conditional expression
false or if the associated state becomes inactive.
duration operator does not support conditions that
depend on local or output structures. For more information, see Access Bus Signals Through Stateflow Structures.