I am trying to read experimentally collected data into MATLAB via a text file. The data are all integers in eight columns separated by white space.
I want to open the file, read in the data, and then reshape into the representative array.
So, I have:
fileID = fopen('String name of file');
A = fread(fileid);
B = reshape(A, (length(A) / 8), 8);
By default, fread assumes the data are doubles, but when I try to specify integers, such as fread(fileid, inf, 'int'), the data still come out with the wrong values.
The data were output by a Java program as 'int' and were generated in a Linux environment, but are now in Windows (only MATLAB license I have). I assume this is an issue of specifying the correct data type for the fread but I'm not sure.
Any ideas?
dlmreadorcsvimport(disclaimer: my contribution) to read delimited data instead offread