a=uint8(rand(1)*128);b=uint8(rand(1)*128);N=input('请输入1~7的数');c=bitor( bitand(a,bitshift(uint8(2^N-1),7-N)),bitand(b,uint8(2^(7-N)-1)) )[dec2bin(a,7);dec2bin(b,7);dec2bin(c,7)]