How can I put conditional setting (if/else) on switch case block in Simulink?
2 views (last 30 days)
Show older comments
I want to put two conditions, for case 1 and case 2, for example:
case 1 - if u1 >=20
case 2 - elseif u1 <= 20
How can I do this if the switch case block only accept scalar?
0 Comments
Answers (1)
Paul
on 4 Feb 2023
Hi Gabryella,
Please clarify the question. This logic:
case 1 - if u1 >=20
case 2 - elseif u1 <= 20
works when u1 is a scalar, but won't work in the Switch Case because that only checks for equality of integers using ismember-like logic.
0 Comments
See Also
Categories
Find more on Event Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!