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.

    ConditionalSelect

Library

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

ConditionalSelect_0

NameLabelDescriptionData TypeValid Values

u2typ

Control input datatype

String

'double'
'complex'
'int32'
'int16'
'int8'
'uint32'
'uint16'
'uint8'
'boolean'
'inherit'

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'
'u2>a'
'u2<=a'
'u2<a'
'u2~=a'
'u2==a'
'u2==true'

thra

Switch threshold (a)

The value to be compared with the 2nd control input.

Matrix

nzz

Apply zero crossing

Number

0
1

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
1

Ports

NameTypeDescriptionIO TypeNumber

then y=u1

explicit

input

1

if u2&gt;=a

explicit

input

2

else y=u3

explicit

input

3

y

explicit

output

1

Port 5

activation

input

externalActivation

Advanced Properties

NameValueDescription

always active

no

direct-feedthrough

yes

zero-crossing

Depends on parameters

mode

Depends on parameters

continuous-time state

no

discrete-time state

no