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
2009-9-15
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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!