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 - Ais in a category listed in- newcats, then the corresponding element of- Bhas the same value as in- A.
- If - Ahas a category not listed in- newcats, then- Bdoes not have that category. The corresponding elements in- Bare undefined.
- If - newcatslists a category that is not a category of- A, then- Bhas 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