perms
All possible permutations.
📝Syntax
P = perms(v)
📥Input Arguments
Parameter Description
v vector.
📤Output Arguments
Parameter Description
P matrix containing all permutations of the elements of v, in reverse lexicographic order.
📄Description

perms returns a matrix containing all permutations of the elements of vector v. Each row of P is one permutation; there are factorial(numel(v)) rows, listed in reverse lexicographic order.

💡Examples
perms([1 2 3])
🔗See Also
nchoosekfactorial
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub