Obtain a single combination of N numbers taken K at a time.
Updated 22 Feb 2009

View License

comb = ONECOMB(N,K,M) returns the M-th combination of the sorted list of all combinations from NCHOOSEK.
Makes use of a fast algorithm for the generation of a single combination.

NCHOOSEK(1:4,3) =
[ 1 2 3
1 2 4
1 3 4
2 3 4 ]

onecomb(4,3,3) =
[ 1 3 4 ]

Cite As

Darren Rowland (2024). ONECOMB (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Passivity and Sector Bounds in Help Center and MATLAB Answers

Inspired: MATLAB PPT

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes