function M=libread(filename)
fid = fopen(filename, 'r');
sm = fread(fid, 1, 'int32');
sn = fread(fid, 1, 'int32');
M = zeros(sm,sn);
for(i=1:sm)
    for(j=1:sn)
        M(i,j)=fread(fid, 1, 'single');
    end
end
fclose(fid);
