%% Rename All Categories
% Create a categorical array containing states from New England.

A = categorical({'MA';'ME';'CT';'VT';'ME';'NH';'VT';'MA';'NH';'CT';'RI'})

% A is an 11-by-1 categorical array.
%
% Display the categories of A.

categories(A)

% A has six categories.
%
% Rename the categories to use the full state name instead of the abbreviation.

B = renamecats(A,{'Connecticut','Massachusetts',...
    'Maine','New Hampshire','Rhode Island' 'Vermont'})

% Elements of B use the new category names.
%
% Display the categories of B.

categories(B)

% Copyright 2012 The MathWorks, Inc.