How can I exit Simuink completely?

조회 수: 8 (최근 30일)
Jianfei
Jianfei 2025년 2월 20일
댓글: Walter Roberson 2025년 2월 24일
I have a function containing isSimulinkStarted. I want my testcase to test both conditions, but once Simulink has started, it will stay started forever.

답변 (1개)

Nithin
Nithin 2025년 2월 24일
The "isSimulinkStarted" function determines if the Simulink engine is active, rather than checking if a specific model is open. Once the Simulink environment is initialized, such as by opening a model, it remains active until it is explicitly shut down or exiting MATLAB. Therefore, even after opening and then closing a Simulink model, the "isSimulinkStarted" function will still return "true". For more details on the behavior of the "isSimulinkStarted" function, please refer to the documentation: https://www.mathworks.com/help/simulink/slref/issimulinkstarted.html
To check if a specific Simulink model is open, the "bdIsLoaded" function with the name of the model (as input) can be used.
modelName = 'your_model_name'; % Replace with your model's name
isModelOpen = bdIsLoaded(modelName);
For further information about the "bdIsLoaded" function, please refer to the following documentation: https://www.mathworks.com/help/simulink/slref/bdisloaded.html
To determine if any Simulink model is open, replace "modelName" with "gcs". However, it is important to be aware that this will produce an error instead of returning "false" if no Simulink model is currently open.
I hope this is helpful in resolving the issue.
  댓글 수: 1
Walter Roberson
Walter Roberson 2025년 2월 24일
The question is how to shut down the Simulink engine (without closing MATLAB.)
At the moment I do not see any way of shutting down the Simulink engine.

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

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

태그

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by