How to run Simulink with all possible permutations of variables

조회 수: 1 (최근 30일)
Morgan Smith
Morgan Smith 2017년 7월 18일
댓글: Morgan Smith 2017년 7월 18일
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.

답변 (1개)

Sebastian Castro
Sebastian Castro 2017년 7월 18일
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
  댓글 수: 1
Morgan Smith
Morgan Smith 2017년 7월 18일
All the variables are inputs to my model. Most of them are used in function blocks in my model as well. These variables include temperature, flow rate, and storage pressure. I wanted to set up my model so that it would run all combinations of
Pressure A,B,C
temperature A,B,C, D
flow rate A,B,C.
with each other to see how to changed my output.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Automotive Applications에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by