SwitchCase

This block directs the incoming event to one of the output activation ports depending on the value of the regular input.

    SwitchCase

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

SwitchCase_0

NameLabelDescriptionData TypeValid 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
1

nmod

Zero-crossing

Turn this parameter ON to detect the zero crossings. Default is OFF.

Scalar

0
1

Ports

NameTypeDescriptionIO TypeNumber

Port 1

activation

input

externalActivation

Port 2

activation

output

nevout

Port 3

explicit

input

1

Advanced Properties

NameValueDescription

always active

no

direct-feedthrough

yes

zero crossing

no

mode

no

continuous-time state

no

discrete-time state

no