| Financial Toolbox | Search  Help Desk |
| datewrkdy | Examples See Also |
Date of future or past workday.
Syntax
d = datewrkdy(start, nd, hols) d = datewrkdy(start, nd)
Arguments
startndholsnd. An integer. hols and nd must have the same sign.Description
d = datewrkdy(start, nd, hols)
returns the serial number of the date a given number of workdays before or after the start date.
Any input can contain multiple values, but if so, all other inputs must contain the same number of values or a single value that applies to all. For example, if start is an N-row character array of date strings, then nd must be an N-by-1 vector of integers or a single integer. d is then an N-by-1 vector of date numbers.
Use the function datestr to convert serial date numbers to formatted date strings.
Examples
d = datewrkdy('12-dec-1997', 16, 2);
datestr(d)
ans =
06-Jan-1998
nd = [16; 20; 44];
d = datewrkdy('12-dec-1997', nd, 2);
datestr(d)
ans =
06-Jan-1998
12-Jan-1998
13-Feb-1998
See Also
busdate, holidays, isbusday, wrkdydif