How to plot simulation results in a GUI while the simulation is running?
Mostrar comentarios más antiguos
I need to plot the simulation results in a GUI while simulation is running, so that the plot will be updated whenever the simulation results are updated.I have tried using To Workspace block and To File block, both outputs the results to workspace or file only when the simulation is paused or stopped. I cannot pause the simulation neither wait for the simulation to stop just for updating the GUI. Is there any way by which I could plot the simulation result in live on the GUI?

When I am trying to access engineTorque value when the simulation is running, it says variable not found. When I pause the simulation I am able to accesss the engineTorque.But my requirement is to access engineTorque value(time,data) when the simulation is running.
NOTE:
1. The GUI can be opened in another MATLAB instance also.
2. Simulation is started with Sim command.
3. It will be helpful if solutions are specific to R2021a.
Respuesta aceptada
Más respuestas (1)
VBBV
el 2 de Ag. de 2023
0 votos
Use drawnow command for updating the simulation results
Read more about the command here
https://in.mathworks.com/help/matlab/ref/drawnow.html
1 comentario
Dark_Knight
el 2 de Ag. de 2023
Categorías
Más información sobre Simulink Environment Customization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!