How to run Simulink with all possible permutations of variables
1 view (last 30 days)
Show older comments
Hi all, I am trying to run my Simulink model that includes several variables. I want to know how to run it so that my model runs all possible permutations instead of me manually entering or changing the variable data each time. Thanks!
I have tried defining this data in matlab and then setting the constants as each variable name. I have also tried using simin from workspace to import the data stored in matlab. Neither of these options have worked. I keep getting errors regarding the dimension of my data.
0 Comments
Answers (1)
Sebastian Castro
on 18 Jul 2017
Where are these variables used in your Simulink model?
If they are simple parameters, e.g., the value of a Gain block, you should be able to do something fairly simple like:
kVals = 1:10;
for k = 1:numel(kVals)
simout(k) = sim('modelName','FastRestart','on');
end
If they are inputs to the model, then it depends on how your model is set up and may require something more complex.
- Sebastian
See Also
Categories
Find more on Automotive Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!