Main Content

stop

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

Since R2023b

Description

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.

example

Examples

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.

openExample('sldrtex_counter');
set_param('sldrtex_counter','StopTime','60')
myRunStatus = SLDRT.run('sldrtex_counter',Wait="off");
stop(myRunStatus)

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