MATLAB: Simulink if/else block

conditionalifsimulinkstatement

Hi,
I'm looking for the right way to set a conditional statement in Simulink. That's the pseudo-code I wish to have:
if x < 6
y = 0
elseif x > 20
y = 2
else
y = 1
The block if is not really what I'm looking for, I just want a small controller with one input (x) and one output (y).
thx

Best Answer

the block I was looking for was index vector