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.

elapsed

Control chart execution with the elapsed operator

Syntax

elapsed(sec)

Description

example

elapsed(sec) returns the simulation time in seconds (sec) that has elapsed since the activation of the associated state.

The elapsed operator resets the counter for sec to 0 each time the associated state reactivates.

Examples

expand all

At the entry and during actions of the state, y is assigned the length of time that the state has been active.

en, du: y = elapsed(sec);

Tips

  • In state and transition actions, you can use quotation marks to enclose the keyword 'sec'. For example:

    y = elapsed('sec');

Introduced in R2017a