Hello,
Suppose I have a vector of N elements, and I need to find all possible permutations {N \choose n} for n=1,2, ..., N. How can I do that?
Example: Suppose I have the vector [1 2 3], then all possible permutations are: 123 (n=3), 12, 13, 23, (n=2), 1, 2, 3 (n=1)
Thanks
No products are associated with this question.
2 Comments
Direct link to this comment:
http://www.mathworks.de/matlabcentral/answers/39568#comment_81893
doc nchoosek
Direct link to this comment:
http://www.mathworks.de/matlabcentral/answers/39568#comment_81937
I did not know it is built-in in MATLAB. Thanks