Thread Subject: combinations of N matrixes taken K at a time

Subject: combinations of N matrixes taken K at a time

From: tirinacria CICCIOCICCIO

Date: 11 Oct, 2009 17:21:00

Message: 1 of 2

Hey I’m a new user.
I want to perform this:

I have 6 square matrixes A B C D E F
I want to find the possible combinations of these matrixes taken 3 at a time and calculate the product of the determiner of each combination
In order to find all possible combinations I can do this:
MAT={‘A’,’B’,’C’,’D’,’E’,’F’}
comb=nchoosek(MAT,3)
The results is:

comb =

    'A' 'B' 'C'
    'A' 'B' 'D'
    'A' 'B' 'E'
    'A' 'B' 'F'
    'A' 'C' 'D'
    'A' 'C' 'E'
    'A' 'C' 'F'
    'A' 'D' 'E'
    'A' 'D' 'F'
    'A' 'E' 'F'
    'B' 'C' 'D'
    'B' 'C' 'E'
    'B' 'C' 'F'
    'B' 'D' 'E'
    'B' 'D' 'F'
    'B' 'E' 'F'
    'C' 'D' 'E'
    'C' 'D' 'F'
    'C' 'E' 'F'
    'D' 'E' 'F'
Then I know all combinations

Now I want to create with a for cycle a matrix with like this:

Det=[|A|*|B|*|C| , | A|*|B|*D|,………]
How can I perform this multiplication?
The problem is that in the matrix comb, A is a text.
Please give me some advice
Thanks

Subject: combinations of N matrixes taken K at a time

From: Wang Hui

Date: 18 Oct, 2009 16:14:01

Message: 2 of 2

"tirinacria CICCIOCICCIO" <d.accorso@tin.it>
MAT={'A','B','C','D','E','F'};
comb=nchoosek(MAT,3);
MAT='ABCDEF';
comb=nchoosek(MAT,3);
[m,n]=size(comb);
str='Det=[';
for i=1:m
   str=[str,'|',comb(i,1),'|*','|',comb(i,2),'|*','|',comb(i,3),'|,'];
end
str=[str(1:end-1),']'];
eval(str)



<hat45s$s8b$1@fred.mathworks.com>...
> Hey I’m a new user.
> I want to perform this:
>
> I have 6 square matrixes A B C D E F
> I want to find the possible combinations of these matrixes taken 3 at a time and calculate the product of the determiner of each combination
> In order to find all possible combinations I can do this:
> MAT={‘A’,’B’,’C’,’D’,’E’,’F’}
> comb=nchoosek(MAT,3)
> The results is:
>
> comb =
>
> 'A' 'B' 'C'
> 'A' 'B' 'D'
> 'A' 'B' 'E'
> 'A' 'B' 'F'
> 'A' 'C' 'D'
> 'A' 'C' 'E'
> 'A' 'C' 'F'
> 'A' 'D' 'E'
> 'A' 'D' 'F'
> 'A' 'E' 'F'
> 'B' 'C' 'D'
> 'B' 'C' 'E'
> 'B' 'C' 'F'
> 'B' 'D' 'E'
> 'B' 'D' 'F'
> 'B' 'E' 'F'
> 'C' 'D' 'E'
> 'C' 'D' 'F'
> 'C' 'E' 'F'
> 'D' 'E' 'F'
> Then I know all combinations
>
> Now I want to create with a for cycle a matrix with like this:
>
> Det=[|A|*|B|*|C| , | A|*|B|*D|,………]
> How can I perform this multiplication?
> The problem is that in the matrix comb, A is a text.
> Please give me some advice
> Thanks

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
combination Wang Hui 18 Oct, 2009 12:19:03
nchoosek tirinacria 11 Oct, 2009 13:24:01
rssFeed for this Thread

Contact us at files@mathworks.com