- Repainting of figure windows, Simulink block diagrams, and Java® windows.
- Call-backs from figure windows.
- Event handling from Java windows.
Why does Simulink pauses execution on pause command in Matlab-app?
1 次查看(过去 30 天)
显示 更早的评论
I have the problem that Simulink pauses when I call the model in an app (with App Designer) and then use the pause or waitfor command in that app. For this period of time the model continues to run, but the simulation time does not continue.
...
load_system('model');
set_param('model','SimulationCommand','Start');
...
pause(10);
...
Does anyone have any idea how to work around this?
0 个评论
回答(1 个)
Imran
2023-1-2
Hello Paul,
I understand that when you use the 'pause' command in your app in app designer, model continues to run, but the simulation time stops.
The 'pause' command only causes the MATLAB commands and scripts to pause, not the model simulation.
While MATLAB is paused, the following continue to execute:
The way to pause a simulation is by using the following command
set_param('<modelname>','SimulationCommand','pause')
In your case, as the model’s name is 'model', you should replace the pause command with the following command
set_param('model','SimulationCommand','pause')
I hope this would help.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!