File Exchange

image thumbnail

Generation of Random Variates

version 1.0 (3.36 MB) by

generates random variates from over 870 univariate distributions

7 Ratings



View License

This code package provides a framework for generating random samples of univariate distribution functions. It has an Excel database that currently lists over 870 distributions, their parameters as well as references to source material. Using a GUI, users can select from any of these discrete or continuous distributions, specify parameter values and specify the number of samples desired. The program will graph the samples, the PDF/PMF, CDF and a histogram. These samples may also be saved to a user-named local file. The Excel database is readily extensible and a User Guide is included with the package.

Given that this is the author's first submission to Matlab Central as well as first attempt at a Matlab GUI and that there are just under 2000 files in this package, there are bound to be many bugs. The author welcomes any corrections, additions, comments or suggestions.

Comments and Ratings (11)


Yashar (view profile)

Dear James,

Thank you very much for such a great work!

I made cdf and pdf for Poisson-Pascal distribution and then find your file. You have one more input argument called "nmax"; and whatever value you enter for "nmax" does not change the result. I think it is redundant. At least my code worked without that auxiliary argument:

syms j;

Maybe this comment will help you to improve the distribution treasure :)



i am looking for k-distribution but i can't find it, can anyone help me?

How about Distribution of sum of non-identically but independly distrubuted uniform RV, is there anyone who have function for this distrubution.


Junhong YE

The Gauss Hypergeom function pfq works pretty fast , compared with the one of MATLAB. But the performance may not be satisfactory, especially when integration is involved.

Eric Diaz

I think Robert Howrd is being a bit harsh. This package definitely does not deserve 2 stars.

It is obviously the culmination of many years of work by the author and as such deserves much respect. So, I'm ok with having given one more rating of 5 stars to balance his 2 stars.

On the other hand, this could be an exceptionally excellent package, and it is unfortunately restricted from being so by some sub-par programming techniques, as mentioned above. So the overall rank should just be average right now.

Eric Diaz

I'd like to see less use of global variables in your programming of the GUI. It's very difficult to sort through what is causing the problems due to these. Also, I'm not sure, but I think it is generally frowned upon in application programming. It consumes more memory than needed at any given time.

Also, it appears that your reliance on xlsread is causing problems. xlsRead will call the excel server as part of it's internal program. However, not everyone has excel. In fact, I prefer to use the open source office suite called LibreOffice.

Eric Diaz

Could use some basic improvements.
1) Prepend package files to prevent naming conflicts
2) Update help documentation to reflect Matlab standards
3) GUI does seem to have some problems. A readme file would help guide the user.
Otherwise, an impressive collection.

robert howrd

GUI is too large for screen, plots do not show up and are cut off. No way to adjust. Not possible to use as is. GUI design needs much improvement. No README file.

Eric Diaz

Pretty awesome!

Mike Sheppard

Mike Sheppard (view profile)

MATLAB Release
MATLAB 7.8 (R2009a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video