Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Ads

Discussion Groups

Discussion Groups | Matlab DSP | Seeds in random numbre generators...

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

Seeds in random numbre generators... - Pramodh Narayanan - Sep 6 17:57:00 2002



Hi!

I just need to generate random numbers that follow
some distribution like poisson,
exponential,normal,etc. For these distributions there
are functions available directly like poissrnd for
poisson distribution, normrnd for normal
distribution,etc. But every time u run them they give
different sets of random numbers. How do I know what
is the seed used to generate these numbers so that I
can reuse the seed to generate them , if I want to.

Thankx,
Pramodh.





(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: Seeds in random numbre generators... - navaneetha krishnan - Sep 6 21:35:00 2002

The functions poissrnd, normrnd... internally use rand
or randn. You can check which one is used by looking
into the function in an editor.
You can set the seeds of rand or randn thereby making
these wrapper functions repeatable.

Navan
--- Pramodh Narayanan <> wrote:
> Hi!
>
> I just need to generate random numbers that follow
> some distribution like poisson,
> exponential,normal,etc. For these distributions
> there
> are functions available directly like poissrnd for
> poisson distribution, normrnd for normal
> distribution,etc. But every time u run them they
> give
> different sets of random numbers. How do I know what
> is the seed used to generate these numbers so that I
> can reuse the seed to generate them , if I want to.
>
> Thankx,
> Pramodh. __________________________________________________




(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: Seeds in random numbre generators... - Joe Sababa - Sep 8 16:24:00 2002

Hi,
Use the 'state' switch. See the help:
>> help rand

Joe
BSTEX - Equation viewer for Matlab
http://www.geocities.com/bstex2001

--- Pramodh Narayanan <> wrote:
> Hi!
>
> I just need to generate random numbers that follow
> some distribution like poisson,
> exponential,normal,etc. For these distributions
> there
> are functions available directly like poissrnd for
> poisson distribution, normrnd for normal
> distribution,etc. But every time u run them they
> give
> different sets of random numbers. How do I know what
> is the seed used to generate these numbers so that I
> can reuse the seed to generate them , if I want to.
>
> Thankx,
> Pramodh. __________________________________________________




(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )