| Statistics Toolbox | Search  Help Desk |
| betarnd | Examples |
Random numbers from the beta distribution.
Syntax
R = betarnd(A,B) R = betarnd(A,B,m) R = betarnd(A,B,m,n)
Description
R = betarnd(A,B) generates beta 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. R = betarnd(A,B,m) generates beta random numbers with parameters A and B. m is a 1-by-2 vector that contains the row and column dimensions of r. R = betarnd(A,B,m,n) generates an m by n matrix of beta random numbers with parameters A and B.Examples
a = [1 1; 2 2];
b = [1 2; 1 2];
r = betarnd(a,b)
r =
0.6987 0.6139
0.9102 0.8067
r = betarnd(10,10,[1 5])
r =
0.5974 0.4777 0.5538 0.5465 0.6327
r = betarnd(4,2,2,3)
r =
0.3943 0.6101 0.5768
0.5990 0.2760 0.5474