| Statistics Toolbox | ![]() |
Random numbers from the F distribution
Syntax
Description
R = frnd(V1,V2)
generates random numbers from the F distribution with numerator degrees of freedom V1 and denominator degrees of freedom V2. Vector or matrix inputs for V1 and V2 must have the same size, which is also the size of R. A scalar input for V1 or V2 is expanded to a constant matrix with the same dimensions as the other input.
R = frnd(V1,V2,m)
generates random numbers from the F distribution with parameters V1 and V2, where m is a 1-by-2 vector that contains the row and column dimensions of R.
R = frnd(V1,V2,m,n)
generates random numbers from the F distribution with parameters V1 and V2, where scalars m and n are the row and column dimensions of R.
Reproducing the Output of frnd
frnd uses the MATLAB functions rand and randn to generate random numbers. When you call frnd, you change the current states of rand and randn, and thereby alter the output of subsequent calls to frnd or any other functions that depend on rand or randn. If you want to reproduce the output of frnd, reset the states of rand and randn to the same fixed values each time you call frnd. 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
n1 = frnd(1:6,1:6) n1 = 0.0022 0.3121 3.0528 0.3189 0.2715 0.9539 n2 = frnd(2,2,[2 3]) n2 = 0.3186 0.9727 3.0268 0.2052 148.5816 0.2191 n3 = frnd([1 2 3;4 5 6],1,2,3) n3 = 0.6233 0.2322 31.5458 2.5848 0.2121 4.4955
See Also
| friedman | fstat | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |