Concatenate arrays vertically
C = vertcat(
concatenates
A1,A2,…,An
)A1
, A2
, … , An
vertically.
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.
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.