Get Simulation Phase of Simulink Model
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Patrick Merz
el 20 de Mayo de 2021
Comentada: Fangjun Jiang
el 20 de Mayo de 2021
I want to get the current simulation phase of my Simulink model.
Let's take the 'busdemo' model as an example.
open_system('busdemo')
busdemo([],[],[],'compile');
Now the model is in the 'compile' phase and I want to get this information in Matlab.
The Simulink Report Generator seems to provide a check if the model is in the compile phase:
However I'm restricted to Matlab 2016b and I think there should be another way to get the current simulation phase.
Cheers,
Patrick
0 comentarios
Respuesta aceptada
Fangjun Jiang
el 20 de Mayo de 2021
Check the status of a simulation.
get_param('ModelName','SimulationStatus')
The software returns 'stopped', 'initializing', 'running', 'paused', 'compiled', 'updating', 'terminating', or 'external' (used with the Simulink Coder™ product).
4 comentarios
Fangjun Jiang
el 20 de Mayo de 2021
It is probably not a bug, but a bad name.
When you get the SimulationStatus immediately after setting the model to 'compile', it returns 'paused' (though the name 'paused' does not make sense). If the compiling is finished, it returns the status as 'compiled', which makes sense.
'continue' is used to change status after setting 'SimulationCommand' to 'pause'.
To change your status, I think it is model([],[],[],'term')
Más respuestas (0)
Ver también
Categorías
Más información sobre Configure and View Diagnostics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!