Running Simulink Model in for loop

8 次查看(过去 30 天)
I'm trying to run a Simulink model within a for loop so I can vary the input parameters. I tried using the sim command but it takes a long time to compile each run which makes it impractical for generating a large amount of data. Is there any way to reduce the compiling speed or compile the simulation once before the for loop?
Any help is much appreciated. Thanks

采纳的回答

Madhu Govindarajan
Madhu Govindarajan 2018-10-2
I think overall the concept of Model referencing might be of value to you (https://www.mathworks.com/help/simulink/model-reference.html). I say this because, when you reference a model you can set not to recompile this model as long as nothing inside it has changed. Then you would use that setting to not include any of your varying parameters and you do not have to recompile. The catch though would be if you are changing something at the core of your algorithm, then you might be forced to recompile every time.
Just my 2c, Madhu

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Environment Customization 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by