| Statistics Toolbox | Search  Help Desk |
| gamrnd | Examples |
Random numbers from the gamma distribution.
Syntax
R = gamrnd(A,B) R = gamrnd(A,B,m) R = gamrnd(A,B,m,n)
Description
R = gamrnd(A,B) generates gamma random numbers with parameters A and B. The size of R is the common size of A and B if both are matrices. If either parameter is a scalar, the size of R is the size of the other parameter. R = gamrnd(A,B,m) generates gamma random numbers with parameters A and B. m is a 1-by-2 vector that contains the row and column dimensions of R. R = gamrnd(A,B,m,n) generates gamma random numbers with parameters A and B. The scalars m and n are the row and column dimensions of R.Examples
n1 = gamrnd(1:5,6:10)
n1 =
9.1132 12.8431 24.8025 38.5960 106.4164
n2 = gamrnd(5,10,[1 5])
n2 =
30.9486 33.5667 33.6837 55.2014 46.8265
n3 = gamrnd(2:6,3,1,5)
n3 =
12.8715 11.3068 3.0982 15.6012 21.6739