DLMREAD Read ASCII-delimited File
Section: Input/Ouput Functions
UsageLoads a matrix from an ASCII-formatted text file with a delimiter between the entries. This function is similar to the
load -asciicommand, except that it can handle complex data, and it allows you to specify the delimiter. Also, you can read only a subset of the data from the file. The general syntax for the
y = dlmread(filename)
filename is a string containing the name of the file to read.
In this form, FreeMat will guess at the type of the delimiter in the
file. The guess is made by examining the input for common delimiter
characters, which are
,;: or a whitespace (e.g., tab). The text
in the file is preprocessed to replace these characters with whitespace
and the file is then read in using a whitespace for the delimiter.
If you know the delimiter in the file, you can specify it using
this form of the function:
y = dlmread(filename, delimiter)
delimiter is a string containing the delimiter. If
is the empty string, then the delimiter is guessed from the file.
You can also read only a portion of the file by specifying a start row
and start column:
y = dlmread(filename, delimiter, startrow, startcol)
startcol are zero-based. You can also specify
the data to read using a range argument:
y = dlmread(filename, delimiter, range)
range is either a vector
or is specified in spreadsheet notation as
Note that complex numbers can be present in the file if they are encoded
without whitespaces inside the number, and use either
the indicator. Note also that when the delimiter is given, each incidence
of the delimiter counts as a separator. Multiple separators generate
zeros in the matrix.