%%
flag=0;
a=randn(1,1);
if a>=0 || a<=-2
    flag=1;
elseif a<=0 && a>=-1
    flag=2;
else
    flag=3;
end
a
flag

%%
flagb=0;
b=2*rand;
if round(b)==1
    flagb=1;
elseif round(b)~=0
    flagb=2;
end
b
flagb