I have the same error message in Octave and removing 'inf'
solved the problem
close all; clear all;
fid = fopen('mHSdark_20ms_00014.bin');
A = fread(fid, 'uint16');
fclose(fid);
size(A)
Here is an execution result
octave:5> test
ans =
20480 1