Input arrays, specified as numeric arrays, logical arrays, character
arrays, string arrays, categorical arrays, datetime arrays, duration
arrays, cell arrays of character vectors, tables, or timetables. If
you specify the 'rows'
option, A
and B
must
have the same number of columns.
A
and B
must belong to
the same class with the following exceptions:
logical
, char
,
and all numeric classes can combine with double
arrays.
Cell arrays of character vectors can combine with
character arrays or string arrays.
Categorical arrays can combine with character arrays,
cell arrays of character vectors, or string arrays.
Datetime arrays can combine with cell arrays of date
character vectors or single date character vectors.
There are additional requirements for A
and B
based
on data type:
If A
and B
are
both ordinal categorical arrays, they must have the same sets of categories,
including their order. If neither A
nor B
are
ordinal, they need not have the same sets of categories, and the comparison
is performed using the category names. In this case, the categories
of C
are the sorted union of the categories from A
and B
.
If A
and B
are
tables or timetables, they must have the same variable names (except
for order). For tables, row names are ignored, so that two rows that
have the same values, but different names, are considered equal. For
timetables, row times are taken into account, so that two rows that
have the same values, but different times, are not considered equal.
If A
and B
are
datetime arrays, they must be consistent with each other in whether
they specify a time zone.
A
and B
also can be objects
with the following class methods:
The object class methods must be consistent with each
other. These objects include heterogeneous arrays derived from the
same root class. For example, A
and B
can
be arrays of handles to graphics objects.