stateflow "if else if else" structure not working properly
조회 수: 18 (최근 30일)
이전 댓글 표시
hi,
I am trying to make a stateflow chart using the if-else-if-else pattern in the tool panel but somehow the conditions aren't followed and it keeps executing the first condition's action even if the that ain't true.
how can I make it consider other conditions as well?
below attached is the screenshot of the same
the output is always "snow and haze" even if the input changes.
댓글 수: 0
채택된 답변
Les Beckham
2024년 5월 22일
편집: Les Beckham
2024년 5월 22일
I don't have access to Stateflow so I can't test this, but I know that the compound comparisons that you have shown are not allowed in Matlab, so I suspect that they aren't allowed in Stateflow either. The comparisons have to be done separately, then anded together. So, for example, change 0.90 < y < 0.91 to 0.90 < y & y < 0.91.
An example of why this might not be working for you, using Matlab code:
y = 0.1;
tf = 0.9 < y < 0.91
tf2 = 0.9 < y & y < 0.91
추가 답변 (0개)
참고 항목
카테고리
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!