| Financial Toolbox™ | ![]() |
Busday = busdate(Date, Direction, Holiday, Weekend)
Date | Reference date. Enter scalar, vector, or matrix of reference business dates as serial date numbers or date strings. |
Direction | (Optional) Scalar, vector, or matrix of search directions. 1 = next (default) or -1 = previous business day. |
Holiday | (Optional) Vector of holidays and nontrading-day dates. All dates in Holiday must be the same format: either serial date numbers or date strings. (Using serial date numbers improves performance.) If Holiday is not specified, the non-trading day default vector is determined by the routine holidays function. |
Weekend | (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 (default), Weekend = [1 0 0 0 0 0 1]. |
Busday = busdate(Date, Direction, Holiday, Weekend) returns the scalar, vector, or matrix of the next or previous business day(s), depending on Holiday.
Use the function datestr to convert serial date numbers to formatted date strings.
Example 1.
Busday = busdate('3-Jul-2001', 1)
Busday =
731037
datestr(Busday)
ans =
05-Jul-2001
Example 2. You can indicate that Saturday is a business day by appropriately setting the Weekend argument.
Weekend = [1 0 0 0 0 0 0];
July 4, 2003 falls on a Friday. Use busdate to verify that Saturday, July 5, is actually a business day.
Date = datestr(busdate('3-Jul-2003', 1, , Weekend))
![]() | boxcox | busdays | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |