categorical.horzcat
categorical: C = horzcat (A, B, …)
Horizontal concatenation of categorical arrays.
C = horzcat (A, B, … is the equivalent of
the syntax B = [A, B, …] and horizontally
concatenates the categorical arrays A, B, …. All input
arrays must have the same size except along the second dimension. Any of
the input arrays may also be string arrays or cell arrays of character
vectors of compatible size.
If any input array is an ordinal categorical array, then all inputs must be ordinal categorical arrays with the same set and ordering of categories. In this case, C is also an ordinal categorical array with the same set and ordering of categories. If none of the input arrays are ordinal, then they do not need to have the same set of categories. In this case, categorical array C contains the union of the categories from all input arrays. Protected categorical arrays can only be concatenated with other arrays that have the same set of categories but not necessarily in the same order.
Source Code: categorical