% Matlab implementation of BinaryMatrixFile
% Probably only work on 32-bit arch
function data=binRead(fileName)

	
	f=fopen(fileName,'r');
	if f < 0;
		error('file not found');
	end;

	rows = fread(f, 1, 'uint', 0, 'b');
	cols = fread(f, 1, 'uint', 0, 'b');

	data = fread(f, rows*cols, 'double', 0, 'b');

	data = reshape(data, cols, rows)';

	fclose(f);
% endfunction
