Concatenate input signals of same data type to create contiguous output signal
Simulink / Commonly Used Blocks
Simulink / Math Operations
Simulink / Signal Routing
HDL Coder / Math Operations
HDL Coder / Signal Routing
The Concatenate block concatenates the input signals to create an output signal whose elements reside in contiguous locations in memory.
Tip
The Concatenate block is useful for creating an output signal that is nonvirtual. However, to create a vector of function calls, use a Mux block instead.
You use a Concatenate block to define an array of buses. For details about defining an array of buses, see Combine Buses into an Array of Buses.
The Concatenate block operates in either vector or multidimensional array concatenation mode, depending on the setting of its Mode parameter. In either case, the block concatenates the inputs from the top to bottom, or left to right, input ports.
In vector mode, all input signals must be either vectors or row vectors (1-by-M matrices) or column vectors (M-by-1 matrices) or a combination of vectors and either row or column vectors. When all inputs are vectors, the output is a vector.
If any of the inputs are row or column vectors, the output is a row or column vector, respectively.
Multidimensional array mode accepts vectors and arrays of any size. It assumes that the
trailing dimensions are all ones for input signals with lower dimensionality. For
example, if the output is 4-D and the input is [2x3]
(2-D), this
block treats the input as [2x3x1x1]
. The output is always an
array. The Concatenate dimension parameter allows you to
specify the output dimension along which the block concatenates its input
arrays.
If you set the Concatenate dimension parameter to 2
and inputs are 2-D matrices, the block performs horizontal matrix concatenation and
places the input matrices side-by-side to create the output matrix. For example, see
the ex_concatenate_horizontal model:
If you set the Concatenate dimension parameter to 1
and inputs are 2-D matrices, the block performs vertical matrix concatenation and
stacks the input matrices on top of each other to create the output matrix. For
example, see the ex_concatenate_vertical model:
The input matrices must have compatible sizes for concatenation. Horizontal concatenation requires input matrices to have the same number of rows. Vertical concatenation requires the input matrices to have the same number of columns.
If you set the Mode parameter to Multidimensional
array
, the Concatenate dimension parameter to
3
, and the inputs are 2-D matrices, the block performs
multidimensional matrix concatenation. For example, see the ex_concatenate_multidims model:
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|