ConditionalNSelect

This block copies one of its inputs to its output. The first (top), input is the control input; the remaining inputs are data inputs. The value of the control input determines which data input is copied.

    ConditionalNSelect

Library

Activate/Routing

Description

This block specifies the signal routing based on the value of control signal as the first input. The remaining inputs are the possible signals to be copied to the output, they're labeled as case 1, case 2, case 3, based on the starting index 1 or 0 specified in block parameter. When control signal is not an integer, it's rounded to the proper integer value as selection index based on the rounding method defined in block parameter. For example if the control signal is 2, the "case 2" input is copied to the output. This block is suitable for performing switch-case decisions.

Parameters

ConditionalNSelect_0

NameLabelDescriptionData TypeValid Values

nin

Number of inputs

Number of inputs to be copied to output.

Number

base

Base indexing

When 0 is selected, the index counts from 0, the 2nd input is labled case 0. When 1 is selected, the index counts from 1.

Scalar

0
1

rule

Rounding method

Method for rounding the control signal to an integer, when the control signal is a non-integer.

String

'int'
'round'
'ceil'
'floor'

add_default

Add default input port

Add a default input port. If the control does not match any of the inputs, the default input is used.

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

y

explicit

output

1

switch u1

explicit

input

1

Port 3

explicit

input

nin+add_default

Port 4

activation

input

externalActivation

Advanced Properties

NameValueDescription

always active

no

direct-feedthrough

yes

zero-crossing

no

mode

no

continuous-time state

no

discrete-time state

no