How to set the simulation mode to Normal, in case of simulink standalone app?

조회 수: 5 (최근 30일)
Rahul
Rahul 2023년 4월 3일
편집: Rahul 2023년 4월 21일
I am trying to create a standalone application using the MATLAB app designer. I want to control the simulation mode. I want to set the Simulation mode to Normal. I cannot simulate my current simulation model in rapid mode due to some restrictions from the S-Functions.
.
I am using the following code to overwrite the simulation mode.
%% simulinkModel is the Name of the Model
simIn = Simulink.SimulationInput(simulinkModel);
simIn = setModelParameter(simIn, 'SimulationMode', 'Normal');
out = sim(simIn);

답변 (1개)

Gokul Nath S J
Gokul Nath S J 2023년 4월 21일
Hi Rahul,
Based on your query it seems that you want to control the simulation parameters by having it configurable in the application itself. As a possible workaround, you can enabled a push button and once it's activated get a callback to set the setModelParameters to 'Normal'. By doing so, you can have the configurability to choose between the option.
Thanks,
Gokul Nath S J
  댓글 수: 1
Rahul
Rahul 2023년 4월 21일
편집: Rahul 2023년 4월 21일
thank you for your reply, This error is generated from the MATLAB stanad alone app (.exe). I want to control the simulation modes for an exe. And the code that I have used in mention in question is a part of button callback named RunbuttonPushed.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by