view readCSV.m @ 3:475bddaf580c tip

Add report and Presentation
author Dave Moffat <d.j.moffat@qmul.ac.uk>
date Wed, 25 Feb 2015 16:07:05 +0000
parents 26494c0d9ffd
children
line wrap: on
line source
function cellObj = readCSV(filename)

f = fopen(filename);
cellObj = cell(0);
l = fgets(f);
counter = 1;
while 1
    l = fgets(f);
    if(l == -1)
        break;
    end
    lstring = strsplit(l,',');
%     size(lstring)
    for i = 1:size(lstring,2)
        cellObj{counter,i} = lstring(i);
    end
    counter = counter + 1;
end


end