How can I put conditional setting (if/else) on switch case block in Simulink?

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?

Réponses (1)

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.
Maybe you want to use the If and If Action Subsystem blocks, which are a bit more flexible.

Catégories

En savoir plus sur Modeling dans Centre d'aide et File Exchange

Produits

Version

R2022b

Question posée :

le 4 Fév 2023

Réponse apportée :

le 4 Fév 2023

Community Treasure Hunt

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

Start Hunting!

Translated by