I am trying to read the contents of a binary file one byte at a time using the FREAD function. I use the following commands to open a file and then perform the read operation.
fid = fopen('myFile.dat','rt')while ~feof(fid)data = fread(fid,8,'uint8');dec2hex(data)endfclose(fid)
Upon execution, I observe that where ever there is an input sequence 0D(in hex) followed by 0A(in hex) in the source file, the byte for '0D' is ignored in the read input.
I expect to get the data into MATLAB exactly as it is in the input file.
Best Answer