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:
Combination with matrices

Subject: Combination with matrices

From: Gustavo

Date: 5 May, 2009 20:41:40

Message: 1 of 2

Hi,

supposed that i have a matrix like this one,
A = [1 2 3, 4 5 6, 7 8 9]

i need to find all the possible combinations with this matrix in the matlab. Does anybody nows how it is possible?

Thanks

Subject: Combination with matrices

From: Gustavo Morales

Date: 5 May, 2009 21:42:02

Message: 2 of 2

Gustavo <guminozzo@hotmail.com> wrote in message <2725087.60310.1241556131148.JavaMail.jakarta@nitrogen.mathforum.org>...
> Hi,
>
> supposed that i have a matrix like this one,
> A = [1 2 3, 4 5 6, 7 8 9]
>
> i need to find all the possible combinations with this matrix in the matlab. Does anybody nows how it is possible?
>
> Thanks

Hi!

Do you need to mantain the size of your matrix?
 Try this:

reshape(A(randperm(numel(A))),size(A,1),size(A,2))

Best regards from Venezuela!

Tags for this Thread

No tags are associated with 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