I have been using MATLAB for a particular project, and have seemed to find a function that may or may not exist. This question isn't MATLAB specific, more algorithm specific.
I have a list of 12 items, indexed from 1 to 12. I want to be able to create a list of all possible permutations of these 12 items where I only want to select 6 of them per entry.
In MATLAB, there is a function called
perms(A) such that it calculates
n = A.length. However what I am looking for is
n = 12 and
r = 6. Is there a way to either
permsfunction such that it does
n = 6, but in a way that it actually calculates
n = 12and
r = 6.
Write a recursive algorithm to replace the
perms(A)function and create a
Any pointers or tips would be much appreciated and helpful.