terminate
Syntax
Description
terminates the simulation represented by the simout
= terminate(s
)Simulation
object s
and returns the simulation results simout
as a Simulink.SimulationOutput
object.
Use the terminate
function to terminate simulations that have fast
restart enabled.
After a simulation terminates, the next simulation you run for the same model must compile the model and initialize the simulation. Fast restart saves time in iterative simulations of the same model by skipping termination, compilation, and initialization. To ensure the accuracy of simulation results, the software allows modifications to a model that is initialized in fast restart only when the modifications do not require compiling the model. For more information, see Get Started with Fast Restart.
Stopping a simulation using the terminate
function always
terminates the simulation. When you use the terminate
function to stop
a simulation, the simulation status changes to stopping
, then
terminating
, and then inactive
.
To stop a fast restart simulation without terminating the simulation, use the stop
function. Stopping a simulation using the stop
function terminates the
simulation only when fast restart is not enabled.
When you use the
stop
function to stop a simulation that has fast restart enabled, the simulation status changes tostopping
, thenrestarting
, and theninitialized
.When you use the
stop
function to stop a simulation that does not have fast restart enabled, the simulation status changes tostopping
, thenterminating
, and theninactive
.
Input Arguments
Output Arguments
Version History
Introduced in R2024a