필터 지우기
필터 지우기

How to add an If/Then Loop in Simulink

조회 수: 5 (최근 30일)
Anthony Koning
Anthony Koning 2022년 12월 6일
답변: Sabin 2022년 12월 15일
Hello, I'm currently trying to figure out how to get an if/then loop to work in simulink using randomly generated numbers. Essentially, the loop is going to function similarly to a human's biological thermoregulation: generate a number between 35c and 39c. If the number is between the 36.4 and 37.6, then the system is successful. If not, then add/subtract 0.25 and reinput back into the system. Repeat as needed. However, I cannot figure out how to design the system around replacing the input for the proper loop. Could anyone explain how to do this? Thanks for the help.

답변 (1개)

Sabin
Sabin 2022년 12월 15일
Hi,
If you need to iterate your algorithm you can use a For Each Subsystem block and put your algorithm inside. This way you can iterate for N sets of data. I hope this helps.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by