chiu
Newbie level 3

how can i build a binary random generator in MATLAB and the output 0 and 1 with the same probability?
could you please write the code for me? cuz im a very newbie
thank you
---------- Post added at 21:39 ---------- Previous post was at 20:35 ----------
i come up with a way to build it
i=1:100;
b=rand(1:length(i));
b(b>0.5)=1;
b(b<=0.5)=0;
plot(b)
do you think its good? OR do u have any other better way to build it? thanks
could you please write the code for me? cuz im a very newbie
---------- Post added at 21:39 ---------- Previous post was at 20:35 ----------
i come up with a way to build it
i=1:100;
b=rand(1:length(i));
b(b>0.5)=1;
b(b<=0.5)=0;
plot(b)
do you think its good? OR do u have any other better way to build it? thanks