dlmread
(Not recommended) Read ASCII-delimited file of numeric data into matrix
dlmread
is not recommended. Use readmatrix
instead. For more information, see Compatibility
Considerations.
Syntax
Description
M = dlmread(
reads an
ASCII-delimited numeric data file into matrix filename
)M
. The
dlmread
function detects the delimiter from the file and
treats repeated white spaces as a single delimiter.
M = dlmread(
starts reading at row offset filename
,delimiter
,R1
,C1
)R1
and column offset
C1
. For example, the offsets R1=0
,
C1=0
specify the first value in the file.
To specify row and column offsets without specifying a delimiter, use an empty
character as a placeholder, for example, M =
dlmread(filename,'',2,1)
.
Examples
Input Arguments
Tips
Skip header rows or columns by specifying row and column offsets. All values in the file other than headers must be numeric.
Algorithms
dlmread
fills empty delimited fields with zero. When the
dlmread
function reads data files with lines that end with a
nonspace delimiter, such as a semicolon, it returns a matrix, M
, that
has an additional last column of zeros.
dlmread
imports any complex number as a whole into a complex
numeric field. This table shows valid forms for a complex number.
Form | Example |
---|---|
|
|
|
|
Embedded white space in a complex number is invalid and dlmread
regards it as a field delimiter.