Last business date of month
Date = lbusdate(Year, Month, Holiday, Weekend, outputType)
Enter as four-digit integer.
Enter as integer from
(Optional) Vector of holidays and nontrading-day dates. All
(Optional) Vector of length 7, containing
(Optional) A character vector specified as either
Date = lbusdate(Year, Month, Holiday, Weekend, outputType) returns
the serial date number for the last business date of the given year
and month, if neither
Holiday specifies nontrading days. If
specified, but not
outputType, then the type of
the holiday variable controls the type of date. If
a serial date number or date character vector, then
returned as a serial date number. However, if
a datetime array, then
Date is returned as a datetime
outputType is specified, then its value
determines the output type of
Date. This overrides
any influence of
Date is returned as a serial date number.
Date is returned as a datetime array. Any
other values will result in an error.
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
of integers or a single integer.
Date is then a
of date numbers.
Use the function
convert serial date numbers to formatted date character vectors.
Date = lbusdate(2001, 5)
Date = 731002
ans = 31-May-2001
Date = lbusdate(2001, 11,,,'datetime')
Date = 30-Nov-2001
Example 3. 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