Skip to content

perms

specfun · scripts/specfun/perms.m

: p = perms (v)

All permutations of the elements of vector v (MATLAB R2026a order).

Returns a matrix with factorial (numel (v)) rows. Row order matches MATLAB’s recursive construction (last element first as the leading column block). Empty input yields a 1-by-0 result. Character inputs keep class char.