Financial Toolbox
  Go to function:
    Search    Help Desk 
m2xdate    Examples   See Also

MATLAB serial date number to Excel serial date number.

Syntax

Arguments

d
MATLAB serial date number. A vector or scalar.
dsys
Excel date system. A vector or scalar.
0 = 1900 date system (default), in which 1 = January 1, 1900 A.D.
1 = 1904 date system, in which 0 = January 1, 1904 A.D.
Vector arguments must have consistent dimensions.

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:

convert them to Excel date numbers in the 1904 system:

or the 1900 system:

See Also

datenum, datestr, x2mdate



[ Previous | Help Desk | Next ]