mergecats
Merge categories of a categorical array.
Syntax
Section titled “Syntax”B = mergecats(A, oldcats)B = mergecats(A, oldcats, newcat)Description
Section titled “Description”Combines the categories named in oldcats (a cell array) into a single category. With newcat, names the merged category; otherwise, uses the first name in oldcats.
Examples
Section titled “Examples”C = categorical({'red', 'green', 'blue'});mergecats(C, {'red', 'green'}, 'warm')See also
Section titled “See also”addcats— Add categories to a categorical array.removecats— Remove categories from a categorical array.renamecats— Rename categories of a categorical array.