필터 지우기
필터 지우기

Why does Simulink pauses execution on pause command in Matlab-app?

조회 수: 3 (최근 30일)
Paul Schulze
Paul Schulze 2021년 1월 19일
답변: Imran 2023년 1월 2일
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?

답변 (1개)

Imran
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:
  • Repainting of figure windows, Simulink block diagrams, and Java® windows.
  • Call-backs from figure windows.
  • Event handling from Java windows.
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.

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by