%% Group Datetime Data by Month
% Create a 10-by-1 datetime vector with random dates in the year 2016. Then, group the datetime values by month and return the result as a categorical array.

X = datetime(2016,1,randi(365,10,1))

%

Y = discretize(X,'month','categorical')

% Copyright 2012 The MathWorks, Inc.