Last business date of month
Date = lbusdate(Year,Month)
Date = lbusdate(Year,Month,Holiday,Weekend,outputType)
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 example, if
Year is a
of integers, then
Month must be a
of integers or a single integer.
Date is then
N vector of date numbers.
Use the function
convert serial date numbers to formatted date character vectors.
the serial date number for the last business date of the given year
and month using optional input arguments.
Date = lbusdate(
Date is returned as a serial date
Holiday is specified, but not
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.
Date using an input argument for
Date = lbusdate(2001, 5) datestr(Date)
Date = 731002 ans = 31-May-2001
Date using the optional input argument for
Date = lbusdate(2001, 11,,,'datetime')
Date = datetime 30-Nov-2001
Indicate that Saturday is a business day by appropriately setting the
Weekend argument. May 31, 2003, is a Saturday. Use
lbusdate to check that this Saturday is actually the last business day of the month.
Weekend = [1 0 0 0 0 0 0]; Date = datestr(lbusdate(2003, 5, , Weekend))
Date = 31-May-2003
Year— Year to determine occurrence of weekday
Year to determine occurrence of weekday, specified as a 4-digit integer or vector of 4-digit integers.
Month— Month to determine occurrence of weekday
12| vector of integers with values
Month to determine occurrence of weekday, specified as an integer
or vector of integers with values
Holiday— Holidays and nontrading-day dates
holidays(default) | serial date number | date character vector | datetime array
Holidays and nontrading-day dates, specified as vector.
All dates in
Holiday must be the same format:
either serial date numbers, or date character vectors, or datetime
arrays. (Using serial date numbers improves performance.) The
holidays function supplies the default
Weekend— Weekend days
[1 0 0 0 0 0 1](Saturday and Sunday form the weekend) (default) | vector of length 7, containing
1indicates weekend days
Weekend days, specified as a vector of length 7, containing
1 indicates weekend days and the first element
of this vector corresponds to Sunday.
outputType— Year to determine days
'datenum'(default) | character vector with values
Date— Date for the last business date of given year and month
Date for the last business date of a given year and month, returned as a serial date number, date character vector, or datetime array.
Holiday is a serial date number
or date character vector, then
Date is returned
as a serial date number
Holiday is a datetime array,
Date is returned as a datetime array.