Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Mux - Combine several input signals into vector

Library

Signal Routing

Description

The Mux block combines its inputs into a single vector output. An input can be a scalar or vector signal. All inputs must be of the same data type and numeric type. The elements of the vector output signal take their order from the top to bottom, or left to right, input port signals. See How to Rotate a Block for a description of the port order for various block orientations. To avoid adding clutter to a model, Simulink software hides the name of a Demux block when you copy it from the Simulink library to a model. See Mux Signals for information about creating and decomposing vectors.

The Mux block's Number of Inputs parameter allows you to specify input signal names and sizes as well as the number of inputs. You can use any of the following formats to specify this parameter:

The MathWorks encourages using Vector Concatenate blocks rather than Mux blocks to combine vectors. The primary exception is the creation of a vector of function calls, which requires a Mux block. In future releases, Mux blocks may have no unique capabilities and may be deprecated.

If you want to create a composite signal, in which the constituent signals retain their identities and can have different data types, use a Bus Creator block rather than a Mux block. Although you can use a Mux block to create a composite signal, The MathWorks discourages this practice. See Avoiding Mux/Bus Mixtures for more information.

Data Type Support

The Mux block accepts real or complex signals of any data type supported by Simulink software, including fixed-point and enumerated data types.

For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink in the Simulink documentation.

Parameters and Dialog Box

Number of inputs

Specify number and size of inputs.

Settings

Default: 2

You can enter a comma-separated list of signal names for this parameter field.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Display option

Specify the appearance of the block in the model.

Settings

Default: bar

bar

Displays the block in a solid foreground color

none

Mux appears inside the block

signals

Displays signal names next to each port

Command-Line Information

See Block-Specific Parameters for the command-line information.

Characteristics

Virtual

Yes

For more information, see Virtual Blocks in the Simulink documentation.

See Also

Demux

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS