| MATLAB Function Reference | ![]() |
P = perms(v)
P = perms(v), where v is a row vector of length n, creates a matrix whose rows consist of all possible permutations of the n elements of v. Matrix P contains n! rows and n columns.
The command perms(2:2:6) returns all the permutations of the numbers 2, 4, and 6:
6 4 2
6 2 4
4 6 2
4 2 6
2 4 6
2 6 4This function is only practical for situations where n is less than about 15.
![]() | perl | permute | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |