r = binornd(n, p)
r = binornd(n, p, sz)
r = binornd(n, p, sz1, ..., szN)
| Parameter | Description |
|---|---|
| n | nonnegative integer scalar or array: number of trials. |
| p | scalar or array in the range [0, 1]: event probability. |
| sz | scalar, vector, or comma-separated dimensions: output size. |
| Parameter | Description |
|---|---|
| r | array: random values. |
binornd generates binomial distributed random values. Scalar parameters are expanded to match array inputs or the requested output size.
rng(0);
r = binornd(10, 0.3, 2, 3);
| Version | Description |
|---|---|
| 2.0.0 | initial version |