MATLAB: Nchoosek – non consecutive numbers

#nchoosekalgorithmcombinationspermutations

If have a set of 12 numbers (eg. 5, 7, 13, 14, 17, 18, 21, 24, 27, 35, 37, 39) and I would like to calculate a list of all the possible combinations of those numbers using only 7 of them. How would I do that? I don't care to know all the possible permutations of 7 numbers (that's the next step), just the combinations. Thank you.
Using C = m!/n!(m-n)! where m = 12 and n = 7 I know the result should yield a 7 X 792 matrix.

Best Answer

https://www.mathworks.com/help/stats/combnk.html
https://www.mathworks.com/help/matlab/ref/nchoosek.html
Notice the syntax involving v, a vector of specific values.