Main Content

vertcat

Concatenate fi object arrays vertically

Description

C = vertcat(A,B) concatenates B vertically to the end of A when any of A and B is a fi object.

A and B must have the same number of columns. Multidimensional arrays are vertically concatenated along the first dimension. The remaining dimensions must match.

example

C = vertcat(A1,A2,…An) concatenates A1,A2,…An vertically when any of A1,A2,…An is a fi object.

A and B must have the same number of columns. Multidimensional arrays are vertically concatenated along the first dimension. The remaining dimensions must match.

vertcat is equivalent to using square brackets for vertically concatenating arrays. For example, [A; B] is equal to vertcat(A,B) when A and B are compatible arrays.

Horizontal and vertical concatenation can be combined, as in [a b;c d].

[a b; c] is allowed if the number of rows of a equals the number of rows of b, and if the number of columns of a plus the number of columns of b equals the number of columns of c.

The matrices in a concatenation expression can themselves be formed via a concatenation, as in [a b;[c d]].

Note

The fimath and numerictype objects of a concatenated matrix of fi objects C are taken from the leftmost fi object in the list A1,A2,…An.

example

Examples

collapse all

Create two matrices and concatenate them vertically, first by using square bracket notation, and then by using vertcat.

A = fi([1 2 3; 4 5 6])
A = 

     1     2     3
     4     5     6

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 12
B = fi([7 8 9],0,8)
B = 

     7     8     9

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Unsigned
            WordLength: 8
        FractionLength: 4
C = [A; B]
C = 

    1.0000    2.0000    3.0000
    4.0000    5.0000    6.0000
    7.0000    7.9998    7.9998

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 12
D = vertcat(A,B)
D = 

    1.0000    2.0000    3.0000
    4.0000    5.0000    6.0000
    7.0000    7.9998    7.9998

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 12

Note that the numerictype of concatenated matrix D is taken from the leftmost fi object in the input list.

Input Arguments

collapse all

First input, specified as a scalar, vector, matrix, or multidimensional array.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
Complex Number Support: Yes

Second input, specified as a scalar, vector, matrix, or multidimensional array.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
Complex Number Support: Yes

List of inputs, specified as a comma-separated list of elements to concatenate in the order they are specified.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
Complex Number Support: Yes

Extended Capabilities

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

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

HDL Code Generation
Generate VHDL, Verilog and SystemVerilog code for FPGA and ASIC designs using HDL Coder™.

Version History

Introduced before R2006a