How to reduce start time of my simulink model

조회 수: 4 (최근 30일)
D D
D D 2023년 6월 20일
편집: Vinayak Agrawal 2023년 6월 26일
I want to reduce the time to start the simulink model. I found the compilation is taking more time (5 minutes) before starting the model. I am using some reference models in my top model.
So I plan to precompile the model and start from precombiled state when required.
I used below steps to precompile and I think it working
myModel([], [], [], 'compile')
myModel([], [], [], 'term')
But when I start model, again the compilation happens and same time is elapsed Can someone help to start the model from precombiled state.

답변 (1개)

Vinayak Agrawal
Vinayak Agrawal 2023년 6월 21일
편집: Vinayak Agrawal 2023년 6월 26일
Hi DD,
It looks like you're on the right track with precompiling your model. To start the model from the precompiled state, you need to use the `sim` command with the `'internal'` option. Here are the steps you can try:
1. Load the precompiled model by running the `myModel([], [], [], 'load')` command. This loads the precompiled binary file.
2. Run the `sim` command with the `'internal'` option to start the simulation. For example: `sim('myModel', 'internal')`. This starts the simulation from the precompiled state and should skip the compilation step.
Note that the command `'myModel([], [], [], 'term')'` you mentioned is not required for precompiling the model. It is used to terminate a simulation that is running.
Also, keep in mind that if you make any changes to the model or dependencies after precompiling, you will need to re-precompile the model for the changes to take effect.
If you continue to experience issues with the model compiling time, you may also want to consider making optimizations to your model or looking into methods for efficient model execution.k
Hope it helps!

카테고리

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by