Simulink Reference Previous page   Next Page
Multiport Switch

Choose between multiple block inputs

Library

Signal Routing

Description

The Multiport Switch block chooses between a number of inputs. The first (top) input is called the control input, while the rest of the inputs are called data inputs. The value of the control input determines which data input is passed through to the output port.

If the control input is an integer value, then the specified data input is passed through to the output. For example, suppose the Use zero-based indexing parameter is not selected. If the control input is 1, then the first data input is passed through to the output. If the control input is 2, then the second data input is passed through to the output, and so on. If the control input is not an integer value, the block first truncates the value to an integer by rounding to floor. If the truncated control input is less than 1 or greater than the number of input ports, an out-of-bounds error is returned.

You specify the number of data inputs with the Number of input ports parameter. The data inputs can be scalar or vector. The block output is determined by these rules:

The Index Vector block, also in the Signal Routing library, is another implementation of the Multiport Switch block that has different default parameter settings.

Data type support

The control and data inputs of a Multiport Switch block can be signals of any data type supported by Simulink, except Boolean. The Multiport Switch block supports fixed-point data types.

The control inputs must be real. The data inputs can be real or complex.

For a discussion on the data types supported by Simulink, refer to Data Types Supported by Simulink in the Using Simulink documentation.

Parameters and Dialog Box

The Main pane of the Multiport Switch block dialog appears as follows:

Number of input ports
Specify the number of data inputs to the block.
Use zero based indexing
If selected, the block uses zero-based indexing. Otherwise, the block uses one-based indexing.
Sample time (-1 for inherited)
Specify the time interval between samples. To inherit the sample time, set this parameter to -1. See Specifying Sample Time in the online documentation for more information.

The Signal data types pane of the Multiport Switch block dialog appears as follows:

Require all data port inputs to have same data type
Select to require all data port inputs to have the same data type.
Output data type mode
You can choose to inherit the output data type and scaling by backpropagation or by an internal rule. The internal rule causes the output of the block to have the same data type and scaling as the input with the larger positive range.
Round integer calculations toward
Select the rounding mode for fixed-point operations.
Saturate on integer overflow
Select to have overflows saturate.

Characteristics

Direct Feedthrough
Yes
Sample Time
Specified in the Sample time parameter
Scalar Expansion
Yes
Dimensionalized
Yes
Zero Crossing
No


Previous page  Model Info Mux Next page

© 1994-2005 The MathWorks, Inc.