stimLoadAgilent.m 405 Bytes
%Loads a standard Agilent ResPro binary file
%   stimLoadAgilent(filename)
function S = stimLoadAgilent(filename)

    fid = fopen(filename);
    fseek(fid, 9, 'bof');
    Z = fread(fid, 1, 'uint16');
    fseek(fid, 13, 'cof');
    X = fread(fid, 1, 'uint16');
    Y = fread(fid, 1, 'uint16');
    
    fseek(fid, 1020, 'bof');
    
    S = reshape(fread(fid, [X, Y * Z], 'float32'), [X, Y, Z]);