MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayMATLAB Central > MATLAB Newsreader > perms and determinant 

I am using the function perms to generate all possible orderings of up to 7 elements, but I need to know the determinant (+1 or 1) for the permutation matrix which would generate the orderings. The determinant should be 1 for an odd number of element swaps and +1 for an even number of element swaps. 
"Greg von Winckel" wrote in message <ilvbvs$rks$1@ginger.mathworks.com>... 
Thanks, Bruno. I'm a bit confused about what your code is computing. 
On 18 Mrz., 12:35, "Greg von Winckel" <gre...@gmail.com> wrote: 
"Greg von Winckel" wrote in message <ilvg1a$7sn$1@ginger.mathworks.com>... 
Sorry, I reversed incorrectly some commands: 
"Greg von Winckel" wrote in message <ilvbvs$rks$1@ginger.mathworks.com>... 
The function below also avoids the find() function, which is expensive, especially as n becomes large. For the output of perms it really doesn't matter what you use because n is small. 
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.