Products & Services Industries Academia Support User Community Company

Learn more about Communications Blockset   

randseed - Generate prime numbers for use as random number seeds

Syntax

out = randseed
out = randseed(state)
out = randseed(state,m)
out = randseed(state,m,n)
out = randseed(state,m,n,rmin)
out = randseed(state,m,n,rmin,rmax)

Description

The randseed function produces random prime numbers that work well as seeds for random source blocks or noisy channel blocks in Communications Blockset software. It is recommended you use the randseed function when specifying the initial seed parameters of the following blocks: Gaussian, Rayleigh, and Rician Noise Generator.

out = randseed generates a random prime number between 31 and 217-1, using the MATLAB function rand.

out = randseed(state) generates a random prime number after setting the state of rand to the positive integer state. This syntax produces the same output for a particular value of state.

out = randseed(state,m) generates a column vector of m random primes.

out = randseed(state,m,n) generates an m-by-n matrix of random primes.

out = randseed(state,m,n,rmin) generates an m-by-n matrix of random primes between rmin and 217-1.

out = randseed(state,m,n,rmin,rmax) generates an m-by-n matrix of random primes between rmin and rmax.

Examples

To generate a two-element sample-based row vector of random bits using the Bernoulli Random Binary Generator block, you can set Probability of a zero to [0.1 0.5] and set Initial seed to randseed(391,1,2).

To generate three streams of random data from three different blocks in a single model, you can define out = randseed(93,3) in the MATLAB workspace and then set the three blocks' Initial seed parameters to out(1), out(2), and out(3), respectively.

See Also

rand, primes

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS