Simulink models auto simulation?

I have a simulink model. It has two inputs in form of constant blocks. And I have a set of test cases where I need to simulate the model everytime with varying the value of one of the constant block. Right now 1. I run the simulation manually 2. then save the results 3. change the value of one constant block 4. rerun simulation 5. save the results 6. repeat steps 3 to 5. Is there any way to automate this process?

 採用された回答

Sebastian Castro
Sebastian Castro 2015 年 11 月 13 日
編集済み: Sebastian Castro 2015 年 11 月 13 日

0 投票

You can always write MATLAB code that loops through variable values and runs the Simulink model multiple times:
The best way to do this is to create variables for the two Constant block values. This lets you easily make modifications in your script:
C1 = 1;
C2 = 1;
simOut = sim('model', ... );
C1 = 5;
C2 = -42.675; % why not?
simOut = sim('model', ... );
... and so on.
- Sebastian

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Functions についてさらに検索

質問済み:

GD
2015 年 11 月 13 日

編集済み:

2015 年 11 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by