MATLAB: Best way to import this csv

csv

I can't work out how to import this csv file – https://dl.dropbox.com/u/11341635/Data.csv
Have tried various methods but I find a lot of the functions and terms are brand new to me so a lot of the forum posts and help files I'm reading are just over my head.

Best Answer

fid = fopen('Data.csv', 'rt');
fmt = ['%f', '%f', repmat('%f', 1, 20), repmat('%f', 1, 20), repmat('%s', 1, 20)];
dat = textscan(fid, fmt, 'HeaderLines', 1, 'Delimiter', ',');
fclose(fid);
ID = dat{1};
Hl = dat{2};
C = cell2mat(dat(3:22));
AB = cell2mat(dat(23:42));
spkrs = [dat{43:62}];
Now ID, H1, C, and AB are numeric arrays, with the C(:,1) corresponding to C1, C(:,2) corresponding to C2, and so on. And spkrs is now a cell array of strings with spkrs{J,1} corresponding to row J of columns spkrs1, and so on.