How can I import a CSV file into MATLAB?. A row in the file i am working with looks like:
SUNW,2-Jan-98,1998,5,40.125,41.5
There are 36 columns and 10107 rows. The first row contains the column headers. It seems that MATLAB doesn't support importing such kind of CSV files. Using the following textscan
function reads the whole data into one cell array.
data = textscan(fid, '%s %s %d %d %f %f', ...
'HeaderLines',1, 'Delimiter',',', 'CollectOutput',1);
Is there a way I could read the data into different variable for each column?
If you have MATLAB 2011b then you can use the spreadsheet import tool.