%% Determine the Third Wednesday for Given Months and Years
% Find the third Wednesday dates for swaps commencing in the month of October in the years 2002, 2003, and 2004.

Months = [10; 10; 10];
Year = [2002; 2003; 2004];
[BeginDates, EndDates] = thirdwednesday(Months, Year);
datestr(BeginDates)
datestr(EndDates)

%
% Find the third Wednesday dates for swaps commencing in the month of October in the years 2002, 2003, and 2004 using an outputType of 'datetime'.

Months = [10; 10; 10];
Year = [2002; 2003; 2004];
[BeginDates, EndDates] = thirdwednesday(Months, Year,'datetime')

% Copyright 2012 The MathWorks, Inc.