How to run Simulink model in a loop with continuously changing one input parameter?
40 次查看(过去 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 Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!