Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Finding Permutations

Subject: Finding Permutations

From: Jack

Date: 27 Jun, 2010 21:31:05

Message: 1 of 5

Hi;

This question seems easy but do you know how to find all possible permutations for FOUR variables where each variable can take a value from 1 to 10. I want to put all posible permuatations in a single matrix.

Subject: Finding Permutations

From: Oleg Komarov

Date: 27 Jun, 2010 22:01:05

Message: 2 of 5

"Jack " <jack_sama_1981@yahoo.com> wrote in message <i08fup$ri0$1@fred.mathworks.com>...
> Hi;
>
> This question seems easy but do you know how to find all possible permutations for FOUR variables where each variable can take a value from 1 to 10. I want to put all posible permuatations in a single matrix.

doc perms

Oleg

Subject: Finding Permutations

From: Roger Stafford

Date: 27 Jun, 2010 22:32:07

Message: 3 of 5

"Jack " <jack_sama_1981@yahoo.com> wrote in message <i08fup$ri0$1@fred.mathworks.com>...
> Hi;
>
> This question seems easy but do you know how to find all possible permutations for FOUR variables where each variable can take a value from 1 to 10. I want to put all posible permuatations in a single matrix.
- - - - - - - - - -
  If you want each of four variables to be able to assume any value from 1 to 10, independently of the other variables, then you want all possible combinations, of which there are 10^4 = 10000. If you want to restrict them so that no two are alike, then there would be 10!/6! = 5040 of them. Which, if either of these, are you interested in?

Roger Stafford

Subject: Finding Permutations

From: Roger Stafford

Date: 27 Jun, 2010 22:46:05

Message: 4 of 5

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i08jh7$er3$1@fred.mathworks.com>...
> ..... If you want to restrict them so that no two are alike, then there would be 10!/6! = 5040 of them.
- - - - - -
  If it's the second of the above, you will find a function that does this at:

http://www.mathworks.com/matlabcentral/fileexchange/24325-combinator-combinations-and-permutations

by Matt Fig

Roger Stafford

Subject: Finding Permutations

From: Jack

Date: 28 Jun, 2010 00:18:05

Message: 5 of 5

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i08kbd$6la$1@fred.mathworks.com>...
> "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i08jh7$er3$1@fred.mathworks.com>...
> > ..... If you want to restrict them so that no two are alike, then there would be 10!/6! = 5040 of them.
> - - - - - -
> If it's the second of the above, you will find a function that does this at:
>
> http://www.mathworks.com/matlabcentral/fileexchange/24325-combinator-combinations-and-permutations
>
> by Matt Fig
>
> Roger Stafford

Thanks a lot Roger; this is exactly what I needed.

Tags for this Thread

What are tags?

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.

Contact us