I would like to read a (fairly big) log file into a MATLAB string cell in one step. I have used the usual:
s={}; fid = fopen(\'test.txt\'); tline = fgetl(fid); w
I tend to use urlread for this, e.g.:
filename = 'test.txt'; urlname = ['file:///' fullfile(pwd,filename)]; try str = urlread(urlname); catch err disp(err.message) end
The variable str then contains a big block of text of type string (ready for regexp to operate on).