How can I access simulation information with the command SIM in Simulink 7.3 (R2009a)?

1 次查看(过去 30 天)
I would like to start my simulation with the command SIM in the MATLAB command window. Now I would like to obtain information during runtime like the actual simulation time. Is this possible when using the SIM command?

采纳的回答

MathWorks Support Team
The ability to obtain information about the current simulation when using SIM is not available in Simulink 7.3 (R2009a).
This is because the SIM command blocks the MATLAB command window and other commands cannot be executed until the SIM command has completed execution. The advantage is that you can use this for MATLAB-script automation of data processing.
To work around this issue you can use the SET_PARAM command to start/stop your simulation:
set_param(<modelname>,'SimulationCommand','start')
More information can be found at:
<http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/f23-7515.html>
This does not block the MATLAB command window and you can retrieve all the needed information of the current simulation.
MATLAB-file automation: Here you need to check the state of the simulation because the command line is not blocked.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

产品


版本

R2009a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by