How can I put conditional setting (if/else) on switch case block in Simulink?
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?

Answers (1)
Paul
on 4 Feb 2023
0 votes
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.
Categories
Find more on Modeling 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!