c = nchoosek(n, k)
C = nchoosek(v, k)
| Parameter | Description |
|---|---|
| n | nonnegative integer scalar: number of available choices. |
| v | vector containing the available elements. |
| k | nonnegative integer scalar: number of selected elements. |
| Parameter | Description |
|---|---|
| c | binomial coefficient when the first input is a scalar. |
| C | matrix whose rows contain the k-element combinations of v. |
nchoosek(n, k) returns the binomial coefficient for nonnegative integer scalar n.
nchoosek(v, k) returns a matrix containing all k-element combinations of the elements of vector v.
b = nchoosek(5, 2)
C = nchoosek([10 20 30 40], 2)
| Version | Description |
|---|---|
| 2.0.0 | initial version |