function [SimRes, SimTime] = loadSimResults(filename)


fid = fopen(filename, 'rb');

if (fid ~= -1 & isstr(filename))
    Nelem = fread(fid, 1, 'long')

    % !!!!!!!!   VECTORS ARE STORED IN REVERSE ORDER     !!!!!!!!

    SimRes = fread(fid, [Nelem, 12], 'double');

    SimRes = SimRes(Nelem:-1:1, :);

    SimTime = fread(fid, Nelem, 'double');

    SimTime = SimTime(Nelem:-1:1);

    % !!!!!!!!   VECTORS ARE STORED IN REVERSE ORDER     !!!!!!!!

    fclose(fid);
else
    error(['Coud not open file ''' filename '''!']);
end