csvread
(Not recommended) Read comma-separated value (CSV) file
csvread
is not recommended. Use readmatrix
instead. For more information, see Compatibility
Considerations.
Description
M = csvread(
reads a
comma-separated value (CSV) formatted file into array filename
)M
. The file
must contain only numeric values.
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
csvread
fills empty delimited fields with zero. When the
csvread
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.
csvread
imports any complex number as a whole into a complex
numeric field, converting the real and imaginary parts to the specified numeric type.
The table shows valid forms for a complex number.
Form | Example |
---|---|
|
|
|
|
Embedded white space in a complex number is invalid and is regarded as a field delimiter.