I was wondering if there is a function for enumerating all of the permutations of size m from n elements, with repetitions allowed. For example, 3 permutations of [1 0] would be [ 1 1 1;1 1 0;1 0 1;0 1 1;1 0 0; 0 1 0;0 0 1; 0 0 0]. (Analogous to http://www.mathworks.com/matlabcentral/fileexchange/11462-npermutek/content/npermutek.m)
Along similar lines, I was wondering if there is a function for permutations without repetitions, such as 2 elements from [1 2 3] is [1 2;1 3;2 3;2 1;3 1;3 2]. I see that there is a permutations function but it only enumerates permutations of the same size as the original set. Thank you
