Skip to content

vertcat

Vertical concatenation ([A; B]).

C = vertcat(A, B)
C = vertcat(A, B, ...)

Concatenates arrays vertically — equivalent to [A; B] syntax. All inputs must have the same number of columns (or the same size in every dimension other than 1).

vertcat([1 2], [3 4]) % [1 2; 3 4]
vertcat(eye(2), zeros(2)) % 4×2
  • horzcat — Horizontal concatenation ([A, B]).
  • cat — Concatenate arrays along a specified dimension.
  • blkdiag — Block-diagonal matrix from input matrices.