Why does simulink recompiles the simulation every time when using sim command?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154267/image.png)
Im trying to call to sim multiple times through a for loop. The only things that changes each iteration are the values of the plecs parameters blocks inside(the simulation input).
But every time i click the run button of the model it shows the recompilation process in a green box below(a picture is attached).
How can i do compilation only once and in the other times the simulation will just run with the new input ? The problem is that each compilation takes about two seconds and it a long time when using long for loops.
0 Commenti
Risposte (2)
Andreas Goser
il 21 Giu 2016
The "Plecs" keyword suggests there might be a non MathWorks product involved. Can you confirm? Can you try to remove that 3rd party block(s) for debugging purpose and see whether it still recompiles? This is to narrow down if a Simulink or a Plecs specialist is needed.
0 Commenti
omer
il 21 Giu 2016
Modificato: omer
il 21 Giu 2016
2 Commenti
Andreas Goser
il 21 Giu 2016
I see. When this green progress bar promts "compiling" it does very differnt things under the hood. Some of them may be actual "compiling", some not. So basically you point is how to speed that up. I really cannot say that for PLECS. Maybe there is a PLECS specific forum? Certainly also here on MATLAB Answers other users maybe have that experience.
Vedere anche
Categorie
Scopri di più su Programmatic Model Editing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!