| Financial Toolbox | Search  Help Desk |
| m2xdate | Examples See Also |
MATLAB serial date number to Excel serial date number.
Syntax
xd = m2xdate(d, dsys) xd = m2xdate(d)
Arguments
ddsys0 = 1900 date system (default), in which 1 = January 1, 1900 A.D.1 = 1904 date system, in which 0 = January 1, 1904 A.D.Description
xd = m2xdate(d, dsys)
converts MATLAB serial date numbers d to Excel serial date numbers xd. MATLAB date numbers start with 1 = January 1, 0000 A.D., hence there is a difference of 693960 relative to the 1900 date system, or 695422 relative to the 1904 date system. This function is useful with MATLAB Excel Link.
Example
Given MATLAB date numbers for Christmas 1997 through 2000:d = datenum(1997:2000, 12, 25)
d =
729749 730114 730479 730845
convert them to Excel date numbers in the 1904 system:
xd = m2xdate(d, 1)
xd =
34327 34692 35057 35423
or the 1900 system:
xd = m2xdate(d)
xd =
35789 36154 36519 36885
See Also
datenum, datestr, x2mdate