There are a number of factorial(n) permutations for n elements. This function return the kth permutation in lexicographical order.
Should work on all Matlab versions.
W He (2019). kth permutation in lexicographical order (https://www.mathworks.com/matlabcentral/fileexchange/<...>), MATLAB Central File Exchange. Retrieved March 13, 2019.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!