Vector Concatenate - Concatenate input vectors of same data type for iterative processing - Simulink (original) (raw)
Concatenate input vectors of same data type for iterative processing
Libraries:
Simulink / Commonly Used Blocks
Simulink / Math Operations
Simulink / Signal Routing
HDL Coder / Math Operations
HDL Coder / Signal Routing
Alternative Configurations of Vector Concatenate Block:
Matrix Concatenate
Description
The Vector Concatenate block concatenates input signals to create a nonscalar signal that you can iteratively process with a subsystem, for example, a for-each, while-iterator, or for-iterator subsystem.
You can use multiple Vector Concatenate blocks to create the output signal in stages, but the result is flat, as if you used a single block to concatenate the signals.
The signals in the output signal appear in the same order as the input signals for the block. For a description of the port order for various block orientations, see Identify Port Location on Rotated or Flipped Block.
You must use a Vector Concatenate or Matrix Concatenate block to define an array of buses. For more information, see Group Nonvirtual Buses in Arrays of Buses.
Examples
A Vector Concatenate block concatenates the vectors it receives, placing them side-by-side in the output vector.
For example, simulate the VectorConcatenation
model.
The input vectors [1 2] and [3 4] are concatenated to create the output vector [1 2 3 4].
Extended Examples
Ports
Input
First input to concatenate, specified as a scalar, vector, matrix, or array.
- Inputs must be of the same data type.
- Matrix and array inputs are supported only when you setMode to
Multidimensional array
.
When the data type is a Simulink.Bus object, the inputs must be nonvirtual buses.
Data Types: single
| double
| half
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| fixed point
| enumerated
| bus
| image
_N_th input to concatenate, specified as a scalar, vector, matrix, or array.
- Inputs must be of the same data type.
- Matrix and array inputs are supported only when you setMode to
Multidimensional array
.
Dependencies
To add input ports, set Number of inputs to an integer greater than or equal to 2.
Data Types: single
| double
| half
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| fixed point
| enumerated
| bus
| image
Output
Concatenation of input signals along specified dimension. Outputs have the same data type as the input.
Data Types: single
| double
| half
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| fixed point
| enumerated
| bus
| image
Parameters
To edit block parameters interactively, use theProperty Inspector. From the Simulink® Toolstrip, on the Simulation tab, in thePrepare gallery, select Property Inspector.
Specify the number of inputs for the block as a real-valued, positive integer, less than or equal to 65536.
Programmatic Use
To set the block parameter value programmatically, use the set_param function.
Parameter: | NumInputs |
---|---|
Values: | '2' (default) | positive integer in quotes |
Data Types: | char | string |
Example: set_param(gcb,'NumInputs','3')
Select whether the block operates in vector or multidimensional array concatenation mode. The default Mode of the Vector Concatenate block is Vector
. The default Mode of the Matrix Concatenate block is Multidimensional array
.
- When you select
Vector
, the block performs vector concatenation. - When you select
Multidimensional array
, the block performs matrix concatenation.
Mode Setting | Input Signals | Output Signal |
---|---|---|
Vector | VectorsRow vectors (1-by-M matrices)Column vectors (_M_-by-1 matrices)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 | Signals of any dimensionality (scalars, vectors, and matrices) | The output is always an array.Trailing dimensions are assumed to be 1 for lower dimensionality inputs. For example, if the output is 4-D and the input is [2x3] (2-D), this block treats the input as [2x3x1x1].Concatenation is on the dimension that you specify with the Concatenate dimension parameter. |
Programmatic Use
To set the block parameter value programmatically, use the set_param function.
Parameter: | Mode |
---|---|
Values: | 'Vector' | 'Multidimensional array' |
Example: set_param(gcb,'Mode','Vector')
Specify the output dimension along which to concatenate the input arrays.
1
— Concatenate inputs vertically. The vertical matrix concatenation stacks the input matrices on top of each other in the output matrix. When you insert a Vector Concatenate block and setMode toMultidimensional array
, the default is1
.2
— Concatenate inputs horizontally. The horizontal matrix concatenation places the input matrices side-by-side in the output matrix. When you insert a Matrix Concatenate block, the default is2
.3
or more — Perform multidimensional concatenation on the inputs.
The input matrices must have compatible sizes for concatenation. Vertical concatenation requires the input matrices to have the same number of columns. Horizontal concatenation requires input matrices to have the same number of rows.
Dependencies
To enable this parameter, set Mode to Multidimensional array
.
Programmatic Use
To set the block parameter value programmatically, use the set_param function.
Parameter: | ConcatenateDimension |
---|---|
Values: | scalar integer in quotes |
Data Types: | char | string |
Example: set_param(gcb,'ConcatenateDimension','3')
Block Characteristics
Data Types | Boolean | double | enumerated | fixed point | half | image | integer | single |
---|---|---|---|---|---|---|---|
Direct Feedthrough | yes | ||||||
Multidimensional Signals | no | ||||||
Variable-Size Signals | yes | ||||||
Zero-Crossing Detection | no |
Alternative Configurations
Libraries:
Simulink / Math Operations
Simulink / Matrix Operations
DSP System Toolbox / Math Functions / Matrices and Linear Algebra / Matrix Operations
HDL Coder / Math Operations
Extended Capabilities
HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.
HDL Architecture
This block has one default HDL architecture.
HDL Block Properties
ConstrainedOutputPipeline | Number of registers to place at the outputs by moving existing delays within your design. Distributed pipelining does not redistribute these registers. The default is0. For more details, see ConstrainedOutputPipeline (HDL Coder). |
---|---|
InputPipeline | Number of input pipeline stages to insert in the generated code. Distributed pipelining and constrained output pipelining can move these registers. The default is0. For more details, see InputPipeline (HDL Coder). |
OutputPipeline | Number of output pipeline stages to insert in the generated code. Distributed pipelining and constrained output pipelining can move these registers. The default is0. For more details, see OutputPipeline (HDL Coder). |
Complex Data Support
This block supports code generation for complex signals.
FOR-GENERATE Loop Support
For this block, HDL Coder generates code using FOR-GENERATE
loop. For more information, see Unroll For-Generate Loops (HDL Coder)
Version History
Introduced in R2009b