MATLAB: Textscan, dlmread, and importdata all not working

dlmreadimportdatatextscan

I have a very simple text file comprised of 1's and 0's. I have tried to read it into MATLAB with every function I can find, but nonetheless I get an error of some form. dlmread seems the most promising, but it throws a "Mismatch between file and format character vector." error. textscan did not work as it created a 1X1 cell with all of the data in it, and trying A = A{:} also did not work, similar error with importdata. Any help would be much appreciated.

Best Answer

See how this works for you,
fid = fopen('FakeData.txt');
t = textscan(fid, '%s');
fclose(fid)
t2 = cell2mat(cellfun(@str2double, t, 'uniformoutput', false));