categorical

Methods

Method Reference: 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 character vectors, string arrays or cell arrays of character vectors of compatible size, whose texts name categories, or missing values, which are undefined. Empty arrays are ignored. A numeric or logical array is refused, since a number could name a category or its code.

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