How to reduce start time of my simulink model
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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.
0 comentarios
Respuestas (1)
Vinayak Agrawal
el 21 de Jun. de 2023
Editada: Vinayak Agrawal
el 26 de Jun. de 2023
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!
0 comentarios
Ver también
Categorías
Más información sobre Programmatic Model Editing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!