Combinations, n choose k
Version 1.0.0.0 (1.26 KB) by
Bruce Raine
This function finds the combinations of n choose k.
The combination function seems to be missing from MATLAB so this rendition fills the gap.
MYCOMBNK returns combinatorial of n choose k i.e all unique combinations of n elements taken k at a time.
EX: >> mycombnk(6,2)
ans = 15
Cite As
Bruce Raine (2026). Combinations, n choose k (https://www.mathworks.com/matlabcentral/fileexchange/32626-combinations-n-choose-k), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2011a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Mathematics > Elementary Math >
- MATLAB > Mathematics > Elementary Math > Discrete Math >
Find more on Elementary Math in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
