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

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

%
% Set new categories. Include a category that is not a category of A.

B = setcats(A,{'red','pink','blue'})

%
% No element of B is pink, because pink is not a category of A. Assign an element of B to be pink.

B(1,2) = 'pink';
B

%
% Copyright 2015 The MathWorks, Inc.