| Financial Toolbox | Search  Help Desk |
| lbusdate | Examples See Also |
Syntax
d = lbusdate(y, m, hol) d = lbusdate(y, m)
Arguments
ym1 to 12.holhol must be the same format: either serial date numbers or date strings. (Using date numbers improves performance.) The holidays function supplies the default vector.Description
d = lbusdate(y, m, hol)
returns the serial date number for the last business date of the given year y and month m where hol specifies non-trading days.
y and m 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 example, if y is a 1-by-N vector of integers, them m must be a 1-by-N vector of integers or a single integer. d is then a 1-by-N vector of date numbers.
Use the function datestr to convert serial date numbers to formatted date strings.
Examples
d = lbusdate(1997, 5)
d =
729540
datestr(d)
ans =
30-May-1997
y = [1997 1998 1999];
d = lbusdate(y, 5); datestr(d)
ans =
30-May-1997
29-May-1998
28-May-1999
See Also
busdate, eomdate, fbusdate, holidays, isbusday