Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Permutations in matlab
Date: Tue, 18 Aug 2009 08:53:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 5
Message-ID: <h6dq5d$3r0$1@fred.mathworks.com>
References: <h6dfju$juk$1@fred.mathworks.com> <h6dksn$q0v$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1250585581 3936 172.30.248.37 (18 Aug 2009 08:53:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 18 Aug 2009 08:53:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1937388
Xref: news.mathworks.com comp.soft-sys.matlab:564124


> I think you want perms().

Thanks for your post. Infact, I was looking for a command in which I could specify the size of the subset ( not possible in ' perms(set) '  :  all permutations would contain all the elements in the set. )

It is possible to do it in a roundabout way :  take ' combntns(set,n)  '   to get various combinations/subsets of size 'n' . For each of these rows , take perms() to get all possible permutations.  Is it possible to do this using a single built-in command ?