Control chart execution with the count
operator
The count(
operator returns a double value
equivalent to the number of ticks after the conditional expression, C
)C
,
becomes true
. The count
operator is reset if the
conditional expression becomes false
. If the count
operator is used within a state, it is reset when the state that contains it is entered. If
the count
operator is used on a transition, it is reset when the source
state for that transition is entered.
The value for count
is dependent on the step size. Changing the
solver or step size for your Simulink® model affects the result of Stateflow® charts that include the count
operator.
To ensure that your Stateflow chart simulates without error, do not use count with these objects:
Continuous time charts
Graphical, MATLAB®, or Simulink functions
Simulink based states
Transitions that can be reached from multiple states
Default transitions
Use the count
operator in charts that use C or MATLAB as the action language.