vertcat
Concatenate arrays vertically
Description
C = vertcat(
concatenates
A1,A2,…,An
)A1
, A2
, … , An
vertically.
vertcat
is equivalent to using square brackets to vertically
concatenate or append arrays. For example, [A; B]
is the same as
vertcat(A,B)
when A
and B
are
compatible arrays.
Examples
Input Arguments
Algorithms
When concatenating an empty array to a nonempty array, vertcat
omits
the empty array in the output. For example, vertcat([1; 2],[])
returns the
column vector [1; 2]
.
If all input arguments are empty and have compatible sizes, then
vertcat
returns an empty array whose size is equal to the output size as
when the inputs are nonempty. For example, vertcat(zeros(1,0),zeros(2,0))
returns a 3-by-0 empty array. If the input sizes are not compatible, then
vertcat
returns a 0-by-0 empty array.
Extended Capabilities
Version History
Introduced before R2006a