3.22222

3.2 | 18 ratings Rate this file 17 Downloads (last 30 days) File Size: 3.02 KB File ID: #903

Random Variable Generation

by Bill Higley

 

09 Oct 2001 (Updated 11 Dec 2001)

A collection of random variable generators

| Watch this File

File Information
Description

This collection generates random variables and vectors of random variables with various distributions, including Bernoulli, geometric, exponential, Gaussian, Poisson, discrete uniform, and continuous uniform, based on the parameters you input to the function.

MATLAB release MATLAB 6.0 (R12)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (19)
20 Nov 2001 John Hitchcock

i found this program to be simple but also very useful in many applications

11 Dec 2001 Rolf Bartstra

- Although these routines may work well for occasional use, they become extremely
slow when generating large quantities or vectors of random numbers.
- The heading of the Gaussian routine states that "This function creates a Gaussian
random variable with mean 'a' and variance 'd'." , whereas in fact it creates a variable
with STANDARD DEVIATION 'd'.

19 Oct 2002 Jan Reinhard

Function RANDGAUSS(a,d,n) could be a considerable useful than it is now - it is equivalent to NORMRND at the moment. Using multidimensional Gaussians with Covariance Matrices would be a GREAT contribution.

16 Mar 2003 Lina Chang

Thanks for putting together this collection.

19 Mar 2004 Marco Bocchini

I appreciate the possibility to get random numbers between user-selected range.

09 Jul 2004 komkrit koechway  
09 Jul 2004 sriram venkataramanan  
09 Jul 2004 ugur zengin  
25 Mar 2005 sarah stoicanescu  
30 Mar 2005 Rajesh T  
16 Aug 2005 Frederico B

There is a mistake in the RANDUNIFC(a,b,n) function. To compute a vector n of n random variables, you need to change the line (only the part when narg==3):
out = a + (b-a) * rand;
CHANGE TO
out = a + (b-a) * randvec;

27 Mar 2006 raza alshah

do u have idea to solve integral from 0 to inf in matlab. Kindly help me Thanks

06 May 2006 morteza ziaee  
24 Jul 2006 Trent Russi

Nice number generators. Be careful of your terminology. These are random number generators, not random variable generators. Random numbers are simply instances of random variable. Your functions provide an instance of a random variable with a certain distribution. Great job though. Nice and clean and simple.

18 Sep 2006 Jay Patel  
22 Dec 2006 venkat san

student

27 Aug 2008 Ali User  
04 May 2009 Dorra  
23 Jul 2010 Rainer

Poisson noise generator "randpois" is VERY slow !!

Please login to add a comment or rating.
Updates
27 Nov 2001

v1.5: Added 2 more files.

11 Dec 2001

Vectorized most functions

Tag Activity for this File
Tag Applied By Date/Time
statistics Bill Higley 22 Oct 2008 06:38:24
probability Bill Higley 22 Oct 2008 06:38:24
random Bill Higley 22 Oct 2008 06:38:24
communications Bill Higley 22 Oct 2008 06:38:24
poisson Bill Higley 22 Oct 2008 06:38:24
variable Bill Higley 22 Oct 2008 06:38:24
poisson Mandy 02 Nov 2011 09:53:52

Contact us at files@mathworks.com