If you need only 2-element combinations, you can use NDGRID . Please note that all two-element combinations up Nrequire values N^2, so if Matlab starts paging, the process will be slow.
N = 100;
[xx,yy] = ndgrid(1:N,1:N);
allCombinations = [xx(:),yy(:)];
, NDGRID nchoosek.
N ^ 2, , , . (N ^ 2-N)/2 .