Last business date of month
Date = lbusdate(Year, Month, Holiday, Weekend)
Enter as four-digit integer.
Enter as integer from 1 through 12.
(Optional) Vector of holidays and nontrading-day dates. All
(Optional) Vector of length 7, containing 0 and 1, the
value 1 indicating weekend days. The first element of this vector
corresponds to Sunday. Thus, when Saturday and Sunday form the weekend
Date = lbusdate(Year, Month, Holiday, Weekend) returns
the serial date number for the last business date of the given year
Holiday specifies nontrading days.
Month can contain
multiple values. If one contains multiple values, the other must contain
the same number of values or a single value that applies to all. For
Year is a
of integers, then
Month must be a 1-by-n vector
of integers or a single integer.
Date is then a
of date numbers.
Use the function
convert serial date numbers to formatted date strings.
Date = lbusdate(2001, 5)
Date = 731002
ans = 31-May-2001
Example 2. You can indicate
that Saturday is a business day by appropriately setting the
Weekend = [1 0 0 0 0 0 0];
May 31, 2003, is a Saturday. Use
check that this Saturday is actually the last business day of the
Date = datestr(lbusdate(2003, 5, , Weekend))
Date = 31-May-2003