Main Content


Stops execution of current model simulation run and causes MATLAB to wait until execution stops

Since R2023b



stop(statusObj) sets the stop status for an SLDRT.RunStatus object. If the stop function is called during real-time simulation, execution stops and MATLAB® waits until the timeOut period expires. If the stop function is called when execution is not running, the function immediately returns without waiting for the timeOut period to expire.


collapse all

This example shows how to use the stop function to stop a real-time executable within the specified timeout.

Open the model. Set the stop time. Create the SLDRT.RunStatus object. Use the stop function to stop execution.

myRunStatus ='sldrtex_counter',Wait="off");

Input Arguments

collapse all

The SLDRT.RunStatus object provides simulation run status and provides access to data from scopes and logged signals after the simulation run completes.

Example: stop(myRunStatus,25)

Version History

Introduced in R2023b