ConditionalSelect
This block copies the value of the first or the third input to the output based on the value of the second input. If the condition specified by the block parameter is true, then the first input is copied, otherwise the third input is copied. The inputs and the threshold must be the same size as the output, or be scalar.
Library
Activate/Routing
Description
This block copies the value of the first or the third input to the output based on the value of the second input. If the condition specified by the block parameter is true the first input is copied, otherwise the third input is copied. Inputs and threshold must be the same size as the output, scalar can be expanded to be the same size as other input matrix. This block is suitable for performing if-then-else decisions.
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
u2typ | Control input datatype | String | 'double' | |
rule | Copy first input if | When the condition is satisified, first input is copied to the output, otherwise 3rd input is copied. | String | 'u2>=a' |
thra | Switch threshold (a) | The value to be compared with the 2nd control input. | Matrix | |
nzz | Apply zero crossing | Number | 0 | |
externalActivation | External activation | Specifies whether the block receives an external activation or inherits its activation through its regular input ports. When External Activation is selected, an additional activation port is added to the block. By default, external activation is not selected. | Number | 0 |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
then y=u1 | explicit | input | 1 | |
if u2>=a | explicit | input | 2 | |
else y=u3 | explicit | input | 3 | |
y | explicit | output | 1 | |
Port 5 | activation | input | externalActivation |
Advanced Properties
Name | Value | Description |
---|---|---|
always active | no | |
direct-feedthrough | yes | |
zero-crossing | Depends on parameters | |
mode | Depends on parameters | |
continuous-time state | no | |
discrete-time state | no |