%% Bin Numeric Data into Categories
% Use the discretize function (instead of categorical) to bin 100 random numbers into three categories.

x = rand(100,1);
y = discretize(x,[0 .25 .75 1],'categorical',{'small','medium','large'});
summary(y)

% Copyright 2015 The MathWorks, Inc.