Index-> contents reference index search Up-> SPT_HELP SignalGeneratorMain binbits Prev Next SPT_HELP-> SPTFunctionsByCategory Mathematical Functions Data Manipulation Functions SignalGeneratorMain AnalogFilterFunctions FIR Filter Design Window Functions IIR Filter Design FourierFunctions Plotting Functions Histogram Functions SignalGeneratorMain-> binbits nrzbits awgn cawgn ammod pmmod fmmod quadmod sinwave triwave sawwave sqrwave RandNumGens OtherSigGen binbits Headings-> Description Example

Random Binary Bits Function
 Syntax `y = binbits(`N`)` Syntax `y = binbits(`N,M`)` Include: `include spt\binbits.oms` See Also nrzbits
``` ARGUMENTS:    INPUTS:       N = SCALAR, any numerical type, coerced to INTEGER           before processing. Represents the number of rows           in the returned matrix.       M = SCALAR, any numerical type, coerced to INTEGER           before processing. Represents the number of            columns in the returned matrix.    RETURN: MATRIX, type INTEGER, equi-probable binary bits. ```
Description ``` ```Create matrix of random bits (0 or 1). Returns a matrix filled with equi-probable binary bits, i.e., 1s and 0s. Integer type in returned.

Example
Create a 5x6 array of random 1's and 0's: ``` O>binbits(5,6) { [   0 ,   1 ,   0 ,   1 ,   0 ,   1 ] [   0 ,   1 ,   1 ,   1 ,   0 ,   1 ] [   0 ,   0 ,   0 ,   1 ,   0 ,   0 ] [   1 ,   0 ,   0 ,   1 ,   0 ,   0 ] [   1 ,   1 ,   1 ,   0 ,   1 ,   0 ] } ```