Skip to content

removecats

Remove categories from a categorical array.

B = removecats(A)
B = removecats(A, oldcats)

Returns A with the named oldcats categories removed. Data values that referenced those categories become <undefined> (see isundefined). With one argument, removes any categories that have no data values referencing them.

C = categorical({'a', 'b', 'c'});
removecats(C, 'c') % values now {'a', 'b', <undefined>}
  • addcats — Add categories to a categorical array.
  • mergecats — Merge categories of a categorical array.
  • isundefined — Test which categorical entries are undefined.