| Statistics Toolbox | ![]() |
Random numbers from Student's t distribution
Syntax
Description
R = trnd(V)
generates random numbers from Student's t distribution with V degrees of freedom. The size of R is the size of V.
R = trnd(V,m)
generates random numbers from Student's t distribution with V degrees of freedom, where m is a 1-by-2 vector that contains the row and column dimensions of R.
R = trnd(V,m,n)
generates random numbers from Student's t distribution with V degrees of freedom, where scalars m and n are the row and column dimensions of R.
Reproducing the Output of trnd
trnd uses the MATLAB functions rand and randn to generate random numbers. When you call trnd, you change the current states of rand and randn, and thereby alter the output of subsequent calls to trnd or any other functions that depend on rand or randn. If you want to reproduce the output of trnd, reset the states of rand and randn to the same fixed values each time you call trnd. For an example of how to do this, and a list of the Statistics Toolbox functions that depend on rand or randn, see Reproducing the Output of Random Number Functions.
Note
The results in the following examples depend on the current states of rand and randn. If you run the code in these examples, your results may differ from the answers shown here.
|
Examples
noisy = trnd(ones(1,6)) noisy = 19.7250 0.3488 0.2843 0.4034 0.4816 -2.4190 numbers = trnd(1:6,[1 6]) numbers = -1.9500 -0.9611 -0.9038 0.0754 0.9820 1.0115 numbers = trnd(3,2,6) numbers = -0.3177 -0.0812 -0.6627 0.1905 -1.5585 -0.0433 0.2536 0.5502 0.8646 0.8060 -0.5216 0.0891
See Also
| trimmean | tstat | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |