| Financial Toolbox | ![]() |
www.kxcad.net Home > CAE Software Index > MATLAB Index >
Date away from starting date for any day-count basis
NumDays = daysadd(StartDate, NumDays, Basis)
StartDate | Start date. Enter as serial date numbers or date strings. |
NumDays | Integer number of days from start date. Enter a negative integer for dates before start date. |
Basis | (Optional) Day-count basis of the instrument. A vector of integers.
|
Note When using the 30/360 day-count basis, it is not always possible to find the exact date NumDays number of days away because of a known discontinuity in the method of counting days. A warning is displayed if this occurs. |
NumDays = daysadd(StartDate, NumDays, Basis) returns a date NumDays number of days away from StartDate, using the given day-count basis.
NewDate = daysadd('01-Feb-2004', 31)
NewDate =
732009
datestr(NewDate)
ans =
03-Mar-2004
NewDate = daysadd('01-Feb-2004', 31, 1)
NewDate =
732008
datestr(NewDate)
ans =
02-Mar-2004
Stigum, Marcia L. and Franklin Robinson, Money Market and Bond Calculations, Richard D. Irwin, 1996, ISBN 1-55623-476-7
| daysact | daysdif | ![]() |
© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments