You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
This function can be used ti process all subset of cardinal k of set of cardinal k without having them stored in the memory. Typical call would be as following
n = 10;
k = 3;
chunksize = 10;
i = 1:chunksize;
norepetition = false;
while true
if norepetition
c = nchoosek_enum(n, k, i);
else
c = nchoosek_enum(n+k-1, k, i);
c = c - (0:k-1);
end
for r=1:size(c,1)
cr = c(r,:);
endcomb = any(isnan(cr));
if endcomb
break
end
% do somthing with cr
fprintf('%s\n', mat2str(cr))
end
if endcomb
break
end
i = i + chunksize;
end
Cite As
Bruno Luong (2026). nchoosek_enum (https://www.mathworks.com/matlabcentral/fileexchange/91060-nchoosek_enum), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.1 (1.88 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
