function bin_numbers_write(filename,A)
fid = fopen(filename,'w+');
if fid < 0
   fprintf('error opening file\n');
   return;
end
fwrite(fid,size(A),'uint16');
fwrite(fid,A,'double');
fclose(fid);