Documentation

Vector Concatenate, Matrix Concatenate

Concatenate input signals of same data type to create contiguous output signal

  • Library:
  • Simulink / Commonly Used Blocks

    Simulink / Math Operations

    Simulink / Signal Routing

Description

TheConcatenateblock 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 aMuxblock instead.

You use aConcatenate块定义数组的公交车。对德泰ls about defining an array of buses, seeCombine Buses into an Array of Buses.

The Concatenate block operates in either vector or multidimensional array concatenation mode, depending on the setting of itsModeparameter. In either case, the block concatenates the inputs from the top to bottom, or left to right, input ports.

Vector Mode

我n 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.

我f any of the inputs are row or column vectors, the output is a row or column vector, respectively.

Multidimensional Array Mode

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. TheConcatenate dimensionparameter allows you to specify the output dimension along which the block concatenates its input arrays.

我f you set theConcatenate dimensionparameter to2and 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 theex_concatenate_horizontalmodel:

我f you set theConcatenate dimensionparameter to1and 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 theex_concatenate_verticalmodel:

For horizontal concatenation, the input matrices must have the same column dimension. For vertical concatenation, the input matrices must have the same row dimension. All input signals must have the same dimension for all dimensions other than the concatenation dimensions.

我f you set theModeparameter toMultidimensional array,Concatenate dimensionparameter to3, and the inputs are 2-D matrices, the block performs multidimensional matrix concatenation. For example, see theex_concatenate_multidimsmodel:

Ports

我nput

expand all

First input to concatenate, specified as a scalar, vector, matrix, or N-D array.

Dependencies

  • 我nputs must be of the same data type.

  • Matrix and N-D array inputs are supported only when you setModetoMultidimensional array.

Data Types:single|double|int8|int16|int32|uint8|uint16|uint32|Boolean|fixed point|enumerated|bus

Nth input to concatenate, specified as a scalar, vector, matrix, or N-D array.

Dependencies

  • To enable this port, setNumber of inputsto an integer greater than or equal to 2.

  • 我nputs must be of the same data type.

  • Matrix and N-D array inputs are supported only when you setModetoMultidimensional array.

Data Types:single|double|int8|int16|int32|uint8|uint16|uint32|Boolean|fixed point|enumerated|bus

Output

expand all

Concatenation of input signals, along specified dimension. Outputs have the same data type as the input.

Data Types:single|double|int8|int16|int32|uint8|uint16|uint32|Boolean|fixed point|enumerated

Parameters

expand all

Specify the number of inputs for the block as a real-valued, positive integer, less than or equal to 65536.

Programmatic Use

Block Parameter:NumInputs
Type:character vector
Values:positive integer
Default:'2'

Select the type of concatenation that this block performs. The defaultModeof the Vector Concatenate block isVector. The defaultModeof the Matrix Concatenate block isMultidimensional array.

  • When you selectVectorthe block performs vector concatenation (seeVector Modefor details).

  • When you selectMultidimensional array,block performs matrix concatenation (seeMultidimensional Array Modefor details).

Programmatic Use

Block Parameter:Mode
Type:character vector
Values:'Vector' | 'Multidimensional array'
Default:'Vector'

Specify the output dimension along which to concatenate the input arrays.

  • To concatenate input arrays vertically, enter1.

  • To concatenate input arrays horizontally, enter2.

  • To perform multidimensional concatenation on the inputs, specify an integer greater than 2.

Dependencies

To enable this parameter, setModetoMultidimensional array.

Programmatic Use

Block Parameter:ConcatenateDimension
Type:character vector
Values:scalar integer
Default:'1'

Block Characteristics

Data Types

double|single|Boolean|base integer|fixed point|enumerated

Multidimensional Signals

No

Variable-Size Signals

Yes

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.

Fixed-Point Conversion
Convert floating-point algorithms to fixed point using Fixed-Point Designer™.

我ntroduced in R2009b

Was this topic helpful?