Skip to content

reordercats

datafun · scripts/datafun/reordercats.m

REORDERCATS  Reorder categories in a categorical array (MATLAB R2026a compat).

  B = reordercats(A)
  B = reordercats(A, neworder)

  With one argument, sorts category names alphanumerically.  neworder may be
  a permutation of category names or a numeric permutation of 1:n.