Statistics Toolbox | ![]() ![]() |
Interactive random number generation using histograms for display
Syntax
Description
The randtool
command sets up a graphic user interface for exploring the effects of changing parameters and sample size on the histogram of random samples from the supported probability distributions.
The M-file calls itself recursively using the action and flag parameters. For general use call randtool
without parameters.
To output the current set of random numbers, press the Output button. The results are stored in the variable ans
. Alternatively, use the following command.
r = randtool('output')
places the sample of random numbers in the vector r.
To sample repetitively from the same distribution, press the Resample button.
To change the distribution function, choose from the pop-up menu of functions at the top of the figure.
To change the parameter settings, move the sliders or type a value in the edit box under the name of the parameter. To change the limits of a parameter, type a value in the edit box at the top or bottom of the parameter slider.
To change the sample size, type a number in the Sample Size edit box.
When you are done, press the Close button.
For an extensive discussion, see The randtool Demo.
See Also
disttool
![]() | random | range | ![]() |