csvread
Read a CSV file into a matrix.
Syntax
Section titled “Syntax”M = csvread(filename)M = csvread(filename, row, col)M = csvread(filename, row, col, range)Description
Section titled “Description”Reads numeric data from a comma-separated text file. With row and col (0-based), starts reading from that offset (skips header rows). With a 4-element range = [R1, C1, R2, C2], reads only the rectangular range from (R1, C1) to (R2, C2).
File must contain only numeric values; for mixed-type CSV use readtable.
Example
Section titled “Example”M = csvread('data.csv', 1, 0) % skip first row (header)