%% Set New Categories
% Create a categorical array containing various colors.

A = categorical({'blue','black','red';'red','blue','black';'black','red','blue'})

%
% Set new categories.

B = setcats(A,{'red','black'})

% Elements that were blue in A are undefined in B.
% Copyright 2015 The MathWorks, Inc.