23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Importing Text Data<br />

Table 6-1<br />

ASCII Data File Formats (Continued)<br />

Data Format Sample<br />

Ann Type1 12.34 45 Yes<br />

Joe Type2 45.67 67 No<br />

Grade1 Grade2 Grade3<br />

91.5 89.2 77.3<br />

88.0 67.8 91.0<br />

67.3 78.1 92.5<br />

File<br />

Extension<br />

.txt<br />

.dat<br />

or other<br />

.txt<br />

.dat<br />

or other<br />

Description<br />

See “Importing Numeric Data<br />

with Text Headers” on page<br />

6-80 for information.<br />

See “Importing Numeric Data<br />

with Text Headers” on page<br />

6-80 or “Using the Import<br />

Wizard” on page 6-9 for<br />

information.<br />

If you are familiar with <strong>MATLAB</strong> import functions but are not sure when<br />

to use them, see the following table, which compares the features of each<br />

function.<br />

Table 6-2<br />

ASCII Data Import Function Features<br />

Function Data Type Delimiters<br />

csvread Numeric data Commas<br />

only<br />

dlmread Numeric data Any<br />

character<br />

Number<br />

of Return<br />

Values<br />

One<br />

One<br />

Notes<br />

Primarily used<br />

with spreadsheet<br />

data. See<br />

“Working with<br />

Spreadsheets” on<br />

page 6-97.<br />

Flexible and easy<br />

to use.<br />

6-77

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

Saved successfully!

Ooh no, something went wrong!