This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

after

Control chart execution with the after operator

Syntax

after(n,E)
after(n,time_unit)

Description

example

after(n,E) returns true if the base event E has occurred at least n times since activation of the associated state. Otherwise, the operator returns false.

In a chart with no input events, after(n,tick) or after(n,wakeup) returns true if the chart has woken up n times or more since activation of the associated state.

The after operator resets the counter for E to 0 each time the associated state reactivates.

example

after(n,time_unit) returns true if n units of simulation time have elapsed since activation of the associated state. Otherwise, the operator returns false. Specify time_unit as seconds (sec), milliseconds (msec), or microseconds (usec).

The after operator resets the counter for sec, msec, and usec to 0 each time the associated state reactivates.

Examples

expand all

A status message appears during each CLK cycle, starting 5 clock cycles after activation of the state.

on after(5,CLK): status('on');

A transition out of the associated state occurs only on broadcast of a ROTATE event, but no sooner than 10 CLK cycles after activation of the state.

ROTATE[after(10,CLK)]

After 12.3 seconds of simulation time since activation of the state, temp variable becomes LOW .

on after(12.3,sec): temp = LOW;

After 8 milliseconds of simulation time have passed since activation of the state, a transition out of the associated state occurs.

after(8,msec)

Tips

  • You can use quotation marks to enclose the keywords 'tick', 'wakeup', 'sec', 'msec', and 'usec'. For example, after(5,'tick') is equivalent to after(5,tick).

Introduced in R2014b