| MATLAB Function Reference | ![]() |
Syntax
Description
C = cat( concatenates the arrays dim,A,B)
A and B along dim.
C = cat( concatenates all the input arrays (dim,A1,A2,A3,A4,...)
A1, A2, A3, A4, and so on) along dim.
cat(2,A,B) is the same as [A,B] and cat(1,A,B) is the same as [A;B].
Remarks
When used with comma separated list syntax, cat(dim,C{:}) or cat(dim,C.field) is a convenient way to concatenate a cell or structure array containing numeric matrices into a single matrix.
Examples
concatenating along different dimensions produces:

produce a 3-by-3-by-1-by-2 array.
See Also
The special character []
| case | catch | ![]() |