P = perms(v) returns
a matrix containing all permutations of the elements of vector v in
reverse lexicographic order. Each row of P contains
a different permutation of the n elements in v.
Matrix P has the same data type as v,
and it has n! rows and n columns.