How to run Simulink model in a loop with continuously changing one input parameter?
37 ビュー (過去 30 日間)
古いコメントを表示
I have built a Simulink model and it's inputs are given from scripts. Say suppose my input is "x" and output is "y", I have to simulate the model for different input values (x) and get corresponding outputs (y).
0 件のコメント
回答 (3 件)
Sulaymon Eshkabilov
2019 年 4 月 10 日
% Simulink won't run if the result comes to inf or NaN.
% A bit more complete answer of this problem:
y = cell(zeros(1,5));
for ii=1:5
OUT = sim('simulink_model.slx');
y{ii} = OUT;
end
0 件のコメント
Avinash Prakash
2016 年 6 月 15 日
編集済み: Avinash Prakash
2016 年 6 月 15 日
1 件のコメント
Amardeep Mishra
2018 年 10 月 23 日
How to force the for loop to continue even when sim() returns NaN or infinity?
Andreas Goser
2016 年 6 月 14 日
Most users run this through a MATLAB script and the SIM command. You can also leverage commands like SET_PARAM.
参考
カテゴリ
Help Center および File Exchange で Simulink Environment Customization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!