permn

Generate permutations of 1:n and permutation parity.

You are now following this Submission

For positive integer n, [p,s] = permn(n) returns all permutations of 1:n as a matrix, size-[factorial(n),n], and also returns the permutation parity s, size-[factorial(n),1]. s(j) is +1 for an even permutation p(j,:), and -1 for an odd permutation.

Cite As

Kenneth Johnson (2026). permn (https://in.mathworks.com/matlabcentral/fileexchange/87749-permn), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired by: permutationparity

Tags

Add Tags

Add the first tag.

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0