MATLAB: How to stop a simulation in Simulink from the MATLAB command window

acommanddofromhowiinMATLABsimulationsimulinkstopthewindow

How do I stop a simulation in Simulink from the MATLAB command window?

Best Answer

You can use the following command at the MATLAB command prompt to stop a simulation in SIMULINK from the MATLAB command window:
set_param(gcs, 'SimulationCommand', 'stop')
For more information on what other simulatin commands you can use with SET_PARAM see the Using Simulink Guide here: