combnk
statistics: c = combnk (data, k)
Return all combinations of k elements in data.
k must be a non-negative integer. combnk (data, 0)
returns a 1-by-0 array of the class of data, the one empty
combination.
Source Code: combnk
c = combnk (1:5, 2);
disp ('All pairs of integers between 1 and 5:');
All pairs of integers between 1 and 5:
disp (c);
1 2 1 3 1 4 1 5 2 3 2 4 2 5 3 4 3 5 4 5