There is a bug in reading dataset 58b.
If first byte of binary block corresponds to newline character it is skipped and block is considered to have incorrect length. Consider the following fix.
ind_bb1 = blockLines(11,2) + 3; % index of first byte of binary block
2) replace where appropriate blockLines(12,1) by ind_bb1
I found that the binary uff 58 file read in and then written out from MATLAB could not be read into nCode or Head Acoustics Artemis. Problem appears to be in header section formatting. I can send you a screen shot of the comparison using gvim.