chi2rnd
Generate random data from a chi-squared distribution.
Syntax
rnd=chi2rnd(n)
rnd=chi2rnd(n,r,c)
Inputs
- n
- Degrees of freedom.
- r,c
- Number of matrix rows and columns.
Outputs
- rnd
- Random data.
Examples
n = 5;
rnd = chi2rnd(n)
rnd = 3
n = 5;
r = 1;
c = 5;
rnd = chi2rnd(n,r,c)
rnd = [Matrix] 1 x 5
3 3.0359 4.2942 2.1856 4.1324
Comments
The random number generator can be initialized using rand.