%% Determine the Date for Given Number of Days Away From StartDate
% Determine the NewDate using a date character vector for StartDate.

NewDate = daysadd('01-Feb-2004', 31)
datestr(NewDate)

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

NewDate = daysadd(datetime('01-Feb-2004','Locale','en_US'), 31)

%
% Determine the NewDate using a vector for StartDate.

MoreDays = ['09/07/2002'; '10/22/2002'; '11/05/2002'];
NewDate = daysadd(MoreDays, 31 ,2)
datestr(NewDate)

% Copyright 2012 The MathWorks, Inc.