SwitchCase
This block directs the incoming event to one of the output activation ports depending on the value of the regular input.
Library
ActivationOperations
Description
The SwitchCase block is similar to the If-Then-Else block in that the input and output events are synchronized. The incoming event is directed to one of the output activation ports depending on the value of the regular input. Specifically, the value of the input determines the port number of the output activation port. If this value is not an integer, the floor of the value is used to convert the value into an integer. If the integer value is less than 1, then the value is considered to be 1, and the first output activation port is used. If the integer value is larger than the number of output activation ports, then the value is considered to be equal to the number of output activation ports, and the last output activation port is used.
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
nevout | Number of output event ports | Integer scalar value. Number of the output (event) ports. Default is 2. | Number | |
externalActivation | External activation | This parameter specifies whether the block receives an external activation or inherits its activation through its regular input ports. When External Activation is used, a additional activation port is added to the block. Default is OFF. | Scalar | 0 |
nmod | Zero-crossing | Turn this parameter ON to detect the zero crossings. Default is OFF. | Scalar | 0 |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
Port 1 | activation | input | externalActivation | |
Port 2 | activation | output | nevout | |
Port 3 | explicit | input | 1 |
Advanced Properties
Name | Value | Description |
---|---|---|
always active | no | |
direct-feedthrough | yes | |
zero crossing | no | |
mode | no | |
continuous-time state | no | |
discrete-time state | no |