Communications Blockset | ![]() ![]() |
Generate Bernoulli-distributed random binary numbers
Library
Data Sources sublibrary of Comm Sources
Description
The Bernoulli Binary Generator block generates random binary numbers using a Bernoulli distribution. The Bernoulli distribution with parameter p produces zero with probability p and one with probability 1-p. The Bernoulli distribution has mean value 1-p and variance p(1-p). The Probability of a zero parameter specifies p, and can be any real number between zero and one.
Attributes of Output Signal
The output signal can be a frame-based matrix, a sample-based row or column vector, or a sample-based one-dimensional array. These attributes are controlled by the Frame-based outputs, Samples per frame, and Interpret vector parameters as 1-D parameters. See Signal Attribute Parameters for Random Sources in Using the Communications Blockset for more details.
The number of elements in the Initial seed and Probability of a zero parameters becomes the number of columns in a frame-based output or the number of elements in a sample-based vector output. Also, the shape (row or column) of the Initial seed and Probability of a zero parameters becomes the shape of a sample-based two-dimensional output signal.
Dialog Box
See Also
Binary Error Pattern Generator, Random Integer Generator, Binary Symmetric Channel; randint
(Communications Toolbox), rand
(built-in MATLAB function)
![]() | BCH Encoder | Binary Cyclic Decoder | ![]() |