How can I access simulation information with the command SIM in Simulink 7.3 (R2009a)?
1 view (last 30 days)
Show older comments
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?
Accepted Answer
MathWorks Support Team
on 15 Sep 2009
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 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!