Importing Delimited ASCII Data Files
If your data file uses a character other than a space as a delimiter, you have a choice of several import functions you can use. (See Table 6-2 for a complete list.) The simplest to use is the
For example, consider a file named
ph.dat whose contents are separated by semicolons:
To read the entire contents of this file into an array named
You specify the delimiter used in the data file as the second argument to
dlmread. Note that, even though the last items in each row are not followed by a delimiter,
dlmread can still process the file correctly.
dlmread ignores space characters between data elements. So, the preceding
dlmread command works even if the contents of
|Importing Numeric Text Data||Importing Numeric Data with Text Headers|
© 1994-2005 The MathWorks, Inc.