File Exchange

image thumbnail


version (93.9 KB) by Bill McKeeman
even, odd, cyclical, unique permutations of a set of vectors


Updated 01 Sep 2016

View Version History

View License

Generate permutations of a set of vectors under flag control. The flags are 'all' (n factorial), even', 'odd', 'cycles', 'signs'. Combinations can be used. The flag 'unique' will remove duplicate entries. This file is a compatible extension of MATLAB perms(vec) where vec is a row vector. See also uniqueperms FEX # 18918.

Cite As

Bill McKeeman (2021). perms (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Hannes Helmholz

This function does not seem to run on current Matlab versions anymore (Matlab R2019b on OSX 10.14.6).

I managed to make it run with some very slight code adjustments only. Although, I cannot validate whether it is working perfectly as intended now.

In general, the use of nested functions and pseudo global variables is bad style and very difficult to read.

Bill McKeeman

The version of perms has a bug. It sometimes gives the even permutations instead of the odd permutations and vice versa. It has been corrected and reissued as FX32978. This version, FX10237 should soon be deleted.

Rashid Iqbal


can you please teach me about the dmperm function which calculate the permulation of adajancy matrix.
Please explain this function with example.



MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!