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!