%% Determine Holidays for a Given StartDate and EndDate
% Create a vector of serial date numbers corresponding to all holidays and nontrading dates between a specified StartDate and EndDate:

H = holidays('jan 1 2001', 'jun 23 2001') 
datestr(H)

%
% Alternatively, using a datetime array for StartDate and EndDate returns a datetime array for H.

H = holidays(datetime('1-Jan-2001','Locale','en_US'),...
datetime('23-Jun-2001','Locale','en_US'))

% Copyright 2012 The MathWorks, Inc.