uperm returns permutation matrix.
uperm
uperm(d)
d
Vector
For a given list of numbers, this function outputs a matrix, where each row is a unique permutation of the list.
uperm(c(1, 2))