MATLAB Function Reference Previous page   Next Page

Concatenate arrays horizontally



C = horzcat(A1, A2, ...) horizontally concatenates matrices A1, A2, and so on. All matrices in the argument list must have the same number of rows.

horzcat concatenates N-dimensional arrays along the second dimension. The first and remaining dimensions must match.

MATLAB calls C = horzcat(A1, A2,...) for the syntax C = [A1 A2 ...] when any of A1, A2, etc., is an object.


Create a 3-by-5 matrix, A, and a 3-by-3 matrix, B. Then horizontally concatenate A and B.

See Also

vertcat, cat

Previous page  home hostid Next page

© 1994-2005 The MathWorks, Inc.