randseed

(Removed) Generate prime numbers for use as random number seeds

Compatibility

randseed has been removed. Use rng(N) or rng('shuffle') instead. For more information, see Compatibility Considerations.

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 Toolbox™ software.

Note

The randseed function uses a local stream of numbers that is independent from the global stream of numbers in the MATLAB® software. Use of this function does not affect the state of the global random number stream.

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.

Compatibility Considerations

expand all

Errors starting in R2021a

See Also

| |

Introduced before R2006a