How to reduce the startup time of the simulink model
49 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I have a simulink model involving some masked C-sfunctions and some blocks from a user-defined library.
Every time that I have to launch a simulation, the simulink model is incredibly slow to start up. I understood that simulink takes its time at the startup to compile the model, and to resolve the references..... But the elapsed time is huge (3mins). I'm wondering if there is a way to speed up these operation.
Is there a way to compile the simulink model just one time and not at every simulation?
I try to use the accelerate mode as simulation mode, but it is still too much slow
I read this guide
but I don't get it, I found it too much oriented to profiling and memory allocation...
do you have any suggestions? I have Matlab 7.8 R2009a
thanks 4 reading
6 个评论
Ryan G
2012-9-14
If possible, after the masks have been set, try removing as many callbacks as possible and see how it helps.
采纳的回答
Ryan G
2012-9-14
You could wrap up as much of the model as possible in a subsystem and leave constants/tunable parameters on the top level and create the reference for the subsystem. Once that is done you set the reference to accelerator mode, see how well this works.
If it is still taking a long time to initialize try setting the rebuild option to none in the configuration parameters for model references.
更多回答(2 个)
Luc Gendre
2012-9-14
Hey there!
I was just passing around when I saw your problem. It seems close to something me and other people had recently. But since you are using a 2009a version, I don't know if I will be of some help (I am using 2012a), but I'll tell you what anyway...
My problem came from the fact that matlab tried to connect to the server to check if I can use my toolbox. It does that every first time I am using a toolbox after startup, or if I use a reset command in one of my script (daqreset for example, when I use the DAQ toolbox). So if when you launch a simulation, you use a reset function in Matlab to have a "clean software", then matlab will check again with the server if you can you the different toolboxes.
Try to run this line in matlab:
theInfo = internal.matlab.licensing.getFeatureInfo;
If it takes a couple minutes to be executed, then you might have the same problem as I had. One solution (maybe not the best one), can be found here:
Other wise, sorry for the post, but I would not be of any help...
Good luck! Luc
0 个评论
Federico Rosellini
2017-1-25
Hello everyone!
I have a similar problem with my simulink model. When I try to run the simulation, the compiling process takes a very long time (about 10 minutes!), then the simulation runs normally. This problem started when I introduced a "Distributed Parameters Line" in my model.
Is there a way to fix this problem? I have model version 1.76 R2016b.
Thanks for the attention. Federico
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Environment Customization 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!