EngeeComms.RandomIntegerGenerator
Generates integers randomly distributed in the specified range.
Library |
|
Block |
Description
The system object EngeeComms.RandomIntegerGenerator generates uniformly distributed random integers in the range , where is specified by the property .SetSize.
To generate random binary or integer data, perform the following steps:
-
Create an object EngeeComms.RandomIntegerGenerator and set its properties.
-
Call the object with arguments as if it were a function.
To learn more about how to work with system objects, see Engee system objects.
Syntax
Creation
-
randgen = EngeeComms.RandomIntegerGenerator()
creates a system object to generate integers randomly distributed in the specified range,randgen
with by default properties.Example:
randgen = EngeeComms.RandomIntegerGenerator()
-
randgen = EngeeComms.RandomIntegerGenerator(Name=Value)
creates a system objectrandgen
with the specified propertyName
set to the specified valueValue
. You can specify additional arguments as a name-value pair in any order (Name1
=Value1
,…,NameN
=ValueN
).Example:
randgen = EngeeComms.RandomIntegerGenerator(SetSize=2, OutputDataType=Bool)
Arguments
Output arguments
Out -.
random integer output
scalar
| vector
| matrix
Details
Random integer output returned as a scalar, vector, or matrix. The data type is specified using the * property.OutputDataType*.
The number of rows in the output data is equal to the value of property * SamplesPerFrame and corresponds to the number of samples in one frame. The number of columns in the output data is equal to the number of elements in the property * * * and corresponds to the number of channels.SetSize* and corresponds to the number of channels.
Типы данных |
|
Properties
#
InitialSeed —
initial number
Real number
Details
Initial value for the random number generator as a non-negative integer. If the InitialSeed property is a constant, the resulting sequence is repeatable.
#
SetSize —
size
Real number
Details
Set size, , specified as a positive integer or a vector string of positive integers. The system object generates integers in the range . The number of elements in SetSize corresponds to the number of independent channels output from the system object.
-
If SetSize is a scalar, then all output random variables are independent and identically distributed.
-
If SetSize is a vector, then the length of the vector determines the number of output channels. Channels can have different output ranges.
#
SamplesPerFrame —
counts per output frame
Real number
Details
Counts per frame as a positive integer indicating the number of samples per frame in one output data channel.
Типы данных |
|
#
OutputDataType —
output data type
String
Details
Типы данных |
|
#
SampleTime —
sampling period
Real number
Details
The sampling period specified as a positive number. To inherit the sampling period, set this property to -1
.