23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Dates and Times<br />

Dates and Times<br />

<strong>MATLAB</strong> represents date and time information in either of three formats:<br />

date strings, serial date numbers, or date vectors. You have the choice of using<br />

anyoftheseformats.Ifyouworkwithmorethanonedateandtimeformat,<br />

<strong>MATLAB</strong> provides functions to help you easily convert from one format to<br />

another, (e.g., from a string to a serial date number).<br />

When using date strings, you have an additional option of choosing from 19<br />

different string styles to express date and/or time information.<br />

This section covers the following topics:<br />

• “Types of Date Formats” on page 2-67<br />

• “Conversions Between Date Formats” on page 2-69<br />

• “Date String Formats” on page 2-69<br />

• “OutputFormats”onpage2-70<br />

• “Current Date and Time” on page 2-72<br />

• “Function Summary” on page 2-72<br />

TypesofDateFormats<br />

Thethree<strong>MATLAB</strong>dateandtimeformatsare<br />

• “Date Strings” on page 2-68<br />

• “Serial Date Numbers” on page 2-68<br />

• “Date Vectors” on page 2-68<br />

This table shows examples of the three formats.<br />

Date Format<br />

Date string<br />

Example<br />

02-Oct-1996<br />

Serial date number 729300<br />

Date vector 1996 10 2 0 0 0<br />

2-67

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

Saved successfully!

Ooh no, something went wrong!