%% Determine the Number of Days Between StartDate and EndDate
% Determine the NumDays using date character vectors for StartDate and EndDate.

NumDays = daysdif('3/1/99', '3/1/00', 1)

%
% Determine the NumDays using a datetime array for StartDate.

NumDays = daysdif(datetime('1-Mar-1999','Locale','en_US'), '3/1/00', 1)

%
% Determine the NumDays using a vector for EndDate.

MoreDays = ['3/1/2001'; '3/1/2002'; '3/1/2003']; 
NumDays = daysdif('3/1/98', MoreDays)

% Copyright 2012 The MathWorks, Inc.