Communications Blockset | ![]() ![]() |
Generate a binary vector while controlling the number of 1s
Library
Description
The Binary Vector Noise Generator outputs a random binary vector whose length is the Binary vector length parameter. The Probabilities parameter helps determine how many 1s appear in each output vector. Once the number of 1s is determined, their placement is determined according to a uniform distribution.
If p1, p2,...pm are the entries in the Probabilities parameter, then p1 is the probability that the output vector will have a single 1, p2 is the probability that the output vector will have exactly two 1s, and so on. Note that Probabilities must have sum less than or equal to one, and length less than or equal to the Binary vector length. Also, the probability of a zero vector is one minus the sum of Probabilities.
This block is useful in testing error-control coding algorithms.
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 for more details.
The Binary vector length parameter 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 Probabilities parameter becomes the shape of a sample-based two-dimensional output signal.
Dialog Box
See Also
Bernoulli Random Binary Generator; randerr
(Communications Toolbox)
![]() | Binary Symmetric Channel | Bit to Integer Converter | ![]() |