| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Communications Blockset |
| Contents | Index |
| Learn more about Communications Blockset |
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)
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.
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.
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.
![]() | commstartup | saveas_commblks | ![]() |

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 |