You're close. Assumming that the results you suggest are the correct ones, you need to do this:
fid = fopen('12h_ticks');
ii1 = fread(fid,1,'int32','b'); % int32 or uint32
ii2 = fread(fid,1,'int32','b'); % int32 or uint32
ii3 = fread(fid,1,'int32','b'); % int32 or uint32
ff1 = fread(fid,1,'float32','b'); % single precision
ff2 = fread(fid,1,'float32','b'); % single precision
fclose(fid); % Don't forget to close the file
The outputs are all converted to double precision values by fread
. If you want to keep the data in its native format you can do this instead for the relevant lines:
ii1 = fread(fid,1,'int32=>int32','b');
ii2 = fread(fid,1,'int32=>int32','b');
ii3 = fread(fid,1,'int32=>int32','b');
ff1 = fread(fid,1,'float32=>single','b');
ff2 = fread(fid,1,'float32=>single','b');
Finally, since this is Matlab, you might want to read in the data as two vectors:
ii = fread(fid,3,'int32','b'); % 3-by-1 vector
ff = fread(fid,2,'float32','b'); % 2-by-1 vector