switchCase
Routes an integer control to one of several action outputs.
📝Syntax
Block type: switchCase
📥Input Arguments
Parameter Description
input ports 1 input port: the control value.
📤Output Arguments
Parameter Description
output ports One output per case, plus an optional default output.
📄Description

Routes an integer control to one of several action outputs.

The scalar input is truncated toward zero to an integer and matched against CaseConditions, a cell literal such as {1, [7 9 4]}. The first matching case drives its output to 1.0 and every other output to 0.0. With ShowDefaultCase set to on, an unmatched value drives the last (default) output. There is no fall-through. These outputs are meant to gate action subsystems.

Parameters

Parameter Default value
CaseConditions {1}
ShowDefaultCase on

Block Characteristics

Block type switchCase
Family Logic blocks
Phases ALGEBRAIC

Extended Capabilities

Code generation: supported for C and Rust.

🔗See Also
ifmerge
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub