Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Binary random generatior

Status
Not open for further replies.

chiu

Newbie level 3
Joined
Feb 19, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,316
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 :p 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 ;)
 

Probably you must to manage seed entry to avoid the function return same result always.

+++
 

Don't 0 and 1 have the same probability with a 50% duty-cycle square wave?

John
 

The Quantum Random Bit Generator Service has a free QRBG Matlab Toolbox available:

**broken link removed**

**broken link removed**
 
  • Like
Reactions: blooz

    blooz

    Points: 2
    Helpful Answer Positive Rating
might help:

rand('seed',11111111)
N=100;
round(rand(N,1))
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top