23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

datenum<br />

2datenum<br />

Purpose Serial date number<br />

Syntax N = datenum(DT)<br />

N = datenum(DT,P)<br />

N = datenum(Y,M,D)<br />

N = datenum(Y,M,D,H,MI,S)<br />

Description The datenum function converts date strings and date vectors (defined by<br />

datevec) into serial date numbers. Date numbers are serial days elapsed from<br />

some reference date. By default, the serial day 1 corresponds to 1-Jan-0000.<br />

2-368<br />

N = datenum(DT) converts the date string or date vector DT into a serial date<br />

number. Date strings with two-character years, e.g., 12-june-12, are assumed<br />

to lie within the 100-year period centered about the current year.<br />

Note If DT is a string, it must be in one of the date formats 0, 1, 2, 6, 13, 14,<br />

15, or 16 as defined by datestr.<br />

N = datenum(DT,P) uses the specified pivot year as the starting year of the<br />

100-year range in which a two-character year resides. The default pivot year is<br />

the current year minus 50 years.<br />

N = datenum(Y,M,D) returns the serial date number for corresponding<br />

elements of the Y, M, and D (year, month, day) arrays. Y, M, and D must be arrays<br />

of the same size (or any can be a scalar). Values outside the normal range of<br />

each array are automatically “carried” to the next unit.<br />

N = datenum(Y,M,D,H,MI,S) returns the serial date number for<br />

corresponding elements of the Y, M, D, H, MI, and S (year, month, hour, minute,<br />

and second) array values. Y, M, D, H, MI, and S must be arrays of the same size<br />

(or any can be a scalar).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!