termt
Termination Condition
Syntax
termt(cond, msg)
Description
Causes simulation execution to be terminated when the passed logical condition cond evaluates to TRUE. A text message contained in msg is written to the output window when execution is terminated.
Note that a model may have multiple termination conditions, and that the second argument (message) can be used to indicate which termination condition resulted in the termination of execution. Also note that the termt operator is evaluated as determine by the code section it is placed in. A termt statement in the dynamic section is evaluated at each communication interval, which a termt in the derivative section is evaluated on each derivative calculation, for example.
Example
termt(t >= 10.0, 'Time limit reached.')