%% Determine Day of Week
% Determine the day of the week for an arbitrary date, by specifying 'name' as the second input to the day function.

t = datetime(2014,05,16)

%

d = day(t,'name')

%
% Alternatively, specify 'dayofweek' to return the day of the week as a number.

d = day(t,'dayofweek')

% Copyright 2015 The MathWorks, Inc.