Skip to Main Content Skip to Search
Product Documentation

Stop Simulation - Stop simulation when input is nonzero

Library

Sinks

Description

The Stop Simulation block stops the simulation when the input is nonzero. The simulation completes the current time step before terminating. If the block input is a vector, any nonzero vector element causes the simulation to stop.

When you use the Stop Simulation block in a For Iterator subsystem, the stop action occurs after execution of all the iterations in the subsystem during a time step. The stop action does not interrupt execution until the start of the next time step.

You cannot use the Stop Simulation block to pause the simulation. To create a block that pauses the simulation, see Creating Pause Blocks in the Simulink documentation.

Data Type Support

The Stop Simulation block accepts real signals of type double or Boolean. For more information, see Data Types Supported by Simulink in the Simulink documentation.

Parameters and Dialog Box

Examples

Usage with the Relational Operator Block

You can use the Stop Simulation block with the Relational Operator block to control when a simulation stops. For example, the following model stops simulation when the simulation time reaches 10.

Usage with the Integrator Block

You can use the Stop Simulation block with the Integrator block to control when a simulation stops. For example, the sldemo_absbrake model stops simulation when the saturation port of the Integrator block outputs a value of 1 or –1.

For more information, see the model description.

Characteristics

Sample Time

Inherited from driving block

Dimensionalized

Yes

Zero-Crossing Detection

No

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS