r=0.647;mu1=83.1;sigma1=14;mu2=136.64;sigma2=16.32;x=zeros(1,10000);for i=1:10000 r1=rand;x(i)=(mu2+sigma2*randn)*heaviside(r1-r)+(mu1+sigma1*randn)*heaviside(r-r1);end hist(x)