MATLAB: Does the Switch block provide incorrect output when I use the “greater than” comparison in Simulink 5.0 (R13)

booleangreatersimulinkswitchthanthresholdwrong

I have a boolean input to my Switch block. If I set the comparison to be "greater than or equal to 0.5" it works fine. When I change this to be "greater than", the switch acts like the comparison is never true. This happens even if I change the threshold to be zero.

Best Answer

This is a bug in Simulink 5.0 (R13) in the way that the "greater than" threshold option of the Switch block handles boolean control inputs. Our development staff is currently investigating this issue.
As a workaround, either use the "greater than or equal to" threshold option or convert your boolean signal to double before using it as the control input to the Switch block.