Skip to content

addcats

datafun · scripts/datafun/addcats.m

ADDCATS  Add categories to a categorical array (MATLAB R2026a compat).

  B = addcats(A, newcats)
  B = addcats(A, newcats, 'Before', catname)
  B = addcats(A, newcats, 'After', catname)

  Adds category names without changing existing element values.  By default
  new categories are appended.  Ordinal arrays require 'Before' or 'After'.