%% Determine the Last Day of the Month for Various Dates
% Find the last day of the month using Year and Month.

DayMonth = eomdate(2001, 2)
datestr(DayMonth)

%
% Find the last day of the month using multiples values for Year and a single Month.

Year = [2002 2003 2004 2005];
DayMonth = eomdate(Year, 2);
datestr(DayMonth)

%
% Find the last day of the month using a datetime array for Date.

DayMonth = eomdate(datetime('1-Jan-2015','Locale','en_US'))

%
% Find the last day of the month using an outputType for 'datetime'.

DayMonth = eomdate(2001, 2,'datetime')

% Copyright 2012 The MathWorks, Inc.