Path: news.mathworks.com!not-for-mail
From: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Number of unique combinations from sets
Date: Wed, 7 May 2008 04:08:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 17
Message-ID: <fvr9v3$980$1@fred.mathworks.com>
References: <fvr755$inh$1@fred.mathworks.com>
Reply-To: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
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 1210133283 9472 172.30.248.35 (7 May 2008 04:08:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 7 May 2008 04:08:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:467067


"Daniel " <danielDOTrDOTlittle@gmail.com> wrote in message <fvr755$inh
$1@fred.mathworks.com>...
> Hello,
> I'm looking for a fast method of finding all of the unique 
> combinations of sets of elements (assuming that all sets 
> are the same). 
> .......
> Dan
-------
  I believe the call

 c = nchoosek(1:n,k);

does just what you want for k numbers chosen out of 1:n

Roger Stafford