setcats
Set categories in categorical array
Syntax
Description
B = setcats(
sets
categories in a categorical array. The output array A
,newcats
)B
has the
categories specified by newcats
and elements that correspond to
the elements of the input array A
.
If an element of
A
is in a category listed innewcats
, then the corresponding element ofB
has the same value as inA
.If
A
has a category not listed innewcats
, thenB
does not have that category. The corresponding elements inB
are undefined.If
newcats
lists a category that is not a category ofA
, thenB
has no elements equal to that category.
Examples
Input Arguments
Tips
To change category names in a categorical array, use
renamecats
.
Extended Capabilities
Version History
Introduced in R2014b
See Also
categories
| removecats
| iscategory
| mergecats
| renamecats
| reordercats
| addcats