MATLAB: Import txt file into matlab using programically

image acquisition

I have data in txt file as shown below:
ffffffffffffffffffffffffffff
ffffffffffffffffffffffffffff
01234efefabcdeffffffffffffff
ffffffffffffabcdeabcdeffffff
abcdefabcdefabcdefabcdefabcd
abcdffffffefefefefbabadededf
1234dace56778445dcfacedbebbf
abcdfedfedabce34127432ffedab
now these data i have to take in m file by importing txt file into matlab.For that what matlab code should be written.....
Thanks

Best Answer

fid = fopen(FileName, 'r');
if fid == -1, error('Cannot open file'); end
S = fread(fid, Inf, '*char');
fclose(fid);
Or to use a Matlab function:
S = fileread(FileName);