for j=[5 16 22] s=[]; for i=1:j p=rand(); if p>0.5 then s=s+"["; else s=s+"]"; end end disp(s); x=isbb(s); disp(x); end