% Matlab implementation of BinaryMatrixFile
% Probably only works on 32-bit arch
function binWrite(fileName, data)
	rows = size(data,1);
	cols = size(data,2);

	f = fopen(fileName,'wb');
	if f < 0;
		error('cannot open file');
	end;

	fwrite(f, rows, 'uint', 0, 'b');
	fwrite(f, cols, 'uint', 0, 'b');

	fwrite(f, data', 'double', 0, 'b');

	fclose(f);

%endfunction
