Simulink Reference    
Matrix Concatenation

Concatenate inputs horizontally or vertically

Library

Math Operations

Description

The Matrix Concatenation block concatenates input matrices u1u2, ..., un along rows or columns, where n is specified by the Number of inputs parameter. The block accepts inputs with any combination of built-in Simulink data types and/or fixed-point data types. If all inputs are sample-based, the output is sample-based. Otherwise, the output is frame-based.

Horizontal Matrix Concatenation

When the Concatenation method parameter is set to Horizontal, the block concatenates the input matrices along rows.

For horizontal concatenation, inputs must all have the same row dimension, M, but can have different column dimensions. The output matrix has dimension M-by-Ni, where Ni is the number of columns in input ui (i = 1, 2, ..., n).

When some of the inputs are length-M 1-D vectors while others are M-by-Ni matrices, the vector inputs are treated as M-by-1 matrices.

Vertical Matrix Concatenation

When the Concatenation method parameter is set to Vertical, the block concatenates the input matrices along columns.

When some of the inputs are length-Mi 1-D vectors while others are Mi-by-1 matrices, the vector inputs are treated as Mi-by-1 matrices. (1-D vector inputs are not accepted for vertical concatenation when the other inputs have column dimension greater than 1.)

1-D Vector Concatenation

When all inputs to the Matrix Concatenation block are length-Mi 1-D vectors, the output is a Mi-by-1 matrix containing all input elements concatenated in port order: the elements in the vector input to the top port appear as the first elements in the output, and the elements in the vector input to the bottom port appear as the last elements in the output.

Dialog Box

Number of inputs
The number of matrices to concatenate.
Concatenation method
The dimension along which to concatenate the inputs.

  MATLAB Fcn Memory