%% Determine If a Given Date Is a Business Day
% Determine if Date is a business day.

Busday = isbusday('16 jun 2001')

%
% Determine if a Date vector are business days.

Date = ['15 feb 2001'; '16 feb 2001'; '17 feb 2001'];
Busday = isbusday(Date)

%
% Determine if a Date vector are business days using a datetime array.

Date = ['15-feb-2001'; '16-feb-2001'; '17-feb-2001'];
Busday = isbusday(datetime(Date,'Locale','en_US'))

%
% Set June 21, 2003 (a Saturday) as a business day.

Weekend = [1 0 0 0 0 0 0];
isbusday('June 21, 2003', [], Weekend)

% If the second argument, Holiday, is empty ([ ]), the default Holidays vector (generated with holidays and then associated to the NYSE calendar) is used.
% Copyright 2012 The MathWorks, Inc.