Using Simulink    
Mux

Combine several input signals into a vector or bus output signal.

Library

Signals & Systems

Description

The Mux block combines its inputs into a single output. An input can be a scalar, vector, or matrix signal. Depending on its inputs, the output of a Mux block is a vector or a composite signal, i.e., a signal containing both matrix and vector elements. If all of a Mux block's inputs are vectors or vector-like, the block's output is a vector. A vector-like signal is any signal that is a scalar (one-element vector), a vector, or a single-column or single-row matrix. If any input is a nonvector-like matrix signal, the output of the Mux is a bus signal. Bus signals can drive only virtual blocks, e.g., a Demux, Subsystem, or Go To block.

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

Data Type Support

A Mux block accepts real or complex signals of any data type, including mixed-type vectors.

Parameters and Dialog Box

Number of inputs
The number and dimensionality of inputs. You can enter a comma-separated list of signal names for this parameter field.
Display option
The appearance of the block icon in your model.

Display Option
Appearance of Block in Model
none
Mux appears inside block icon
signals
Displays signal names next to each port
bar
Displays the block icon in a solid foreground color

 Multiport Switch Outport