%% Normalize Data by Day Name
% Create a table of dates and corresponding profits.

timeStamps = datetime([2017 3 4; 2017 3 2; 2017 3 15; 2017 3 10;...
                       2017 3 14; 2017 3 31; 2017 3 25;...
                       2017 3 29; 2017 3 21; 2017 3 18]);
profit = [2032 3071 1185 2587 1998 2899 3112 909 2619 3085]';
T = table(timeStamps,profit)

% Grouping by day name, normalize the profits by the 2-norm.

G = grouptransform(T,'timeStamps','dayname','norm')

% Copyright 2018 The MathWorks, Inc.