Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: combinations of N matrixes taken K at a time
Date: Sun, 11 Oct 2009 17:46:04 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 22
Message-ID: <hat5ks$55s$1@fred.mathworks.com>
References: <hat0le$jeq$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1255283164 5308 172.30.248.35 (11 Oct 2009 17:46:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 11 Oct 2009 17:46:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:576538


"tirinacria CICCIOCICCIO" <d.accorso@tin.it> wrote in message <hat0le$jeq$1@fred.mathworks.com>...

> The problem is that in the matrix comb, A is a text.

When you call nchoosek, you can supply any kind of arrays or cell arrays. Example:

A = rand(5);
B = rand(5);
C = rand(5);
D = rand(5);
E = rand(5);
F = rand(5);

allmystuff =  {A B C D E F};

threestuff = nchoosek(allmystuff, 3);

% Each row of the result THREESTUFF is one combination

If you want to compute the product of determinants, then feed NCHOOSEK with the array of determinants of A, B, ..., F, then compute PROD of the result along the second dimension.

Bruno