Here is the sample code
for ii = 1:Ne
enc_x(ii+1) = r*enc_x(ii)*(1 - enc_x(ii));
enc_y(ii+1) = r*enc_y(ii)*(1 - enc_y(ii));
fid=fopen('my1.bin','w');
if(enc_x(ii)>enc_y(ii))
iwant(ii)=0;
else
iwant(ii)=1;
end
fprintf(fid,'%d \n',iwant);
fclose(fid);