I am working on a project to get all permutations of a 18+ integer vector. Working with the perms function limits me to 9 integers and forces me to do cencatenate the two permuations, but I miss some of my combinations
l1 = [1:1:9]';
l2 = [10:1:18]';
l1perms = perms(l1);
l2perms = perms(l2);
lp = [l1perms,l2perms];
I would like to perform an operation on each possible permutation, but am struggling to develop a code that correctly displays each permutation without requiring a fixed number of for loops. In the code above, I perform an evaluation on each row of lp, but my matrix is limited in size due to the size of the matrix.
Ideally, the user would be able to put in a vector and the program would evaluate each permutation where the length of the original vector can vary from 18 to 30 integers.