<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258760</link>
    <title>MATLAB Central Newsreader - Permutations in matlab</title>
    <description>Feed for thread: Permutations in matlab</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 18 Aug 2009 05:53:02 -0400</pubDate>
      <title>Permutations in matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258760#673884</link>
      <author>Midhun </author>
      <description>Hello,&lt;br&gt;
&amp;nbsp;How can I do permutations in matlab ? &lt;br&gt;
&lt;br&gt;
In Matalb , the command :   ' combntns(set,subset)'  returns a matrix whose rows are the various combinations that can be taken of the elements of the vector set of length subset.&lt;br&gt;
&lt;br&gt;
How can I create a 'permutational' set instead of a 'combinatorial' set ?  </description>
    </item>
    <item>
      <pubDate>Tue, 18 Aug 2009 07:23:03 -0400</pubDate>
      <title>Re: Permutations in matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258760#673894</link>
      <author>Husam Aldahiyat</author>
      <description>&quot;Midhun &quot; &amp;lt;midhunjoyp@gmail.com&amp;gt; wrote in message &amp;lt;h6dfju$juk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hello,&lt;br&gt;
&amp;gt;  How can I do permutations in matlab ? &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; In Matalb , the command :   ' combntns(set,subset)'  returns a matrix whose rows are the various combinations that can be taken of the elements of the vector set of length subset.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; How can I create a 'permutational' set instead of a 'combinatorial' set ?  &lt;br&gt;
&lt;br&gt;
I think you want perms().</description>
    </item>
    <item>
      <pubDate>Tue, 18 Aug 2009 08:53:01 -0400</pubDate>
      <title>Re: Permutations in matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258760#673908</link>
      <author>Midhun </author>
      <description>&amp;gt; I think you want perms().&lt;br&gt;
&lt;br&gt;
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. )&lt;br&gt;
&lt;br&gt;
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 ?</description>
    </item>
    <item>
      <pubDate>Tue, 18 Aug 2009 09:24:06 -0400</pubDate>
      <title>Re: Permutations in matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258760#673918</link>
      <author>arun</author>
      <description>On Aug 18, 10:53&#160;am, &quot;Midhun &quot; &amp;lt;midhunj...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; I think you want perms().&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 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) ' &#160;: &#160;all permutations would contain all the elements in the set. )&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; It is possible to do it in a roundabout way : &#160;take ' combntns(set,n) &#160;' &#160; to get various combinations/subsets of size 'n' . For each of these rows , take perms() to get all possible permutations. &#160;Is it possible to do this using a single built-in command ?&lt;br&gt;
&lt;br&gt;
yes there is no direct function for permutations, as there is 1 for&lt;br&gt;
combinations. Probably because its not possible to store the&lt;br&gt;
permutations for n&amp;gt;= 11 (documentation says it takes over 3GB).&lt;br&gt;
&lt;br&gt;
however, for small amount of numbers you could do,&lt;br&gt;
&lt;br&gt;
a = 1:4;&lt;br&gt;
&lt;br&gt;
acn = nchoosek(a,3);&lt;br&gt;
result = arrayfun(@(x) perm(acn(x,:)), 1:length(acn), 'uni', false);&lt;br&gt;
result = cat(1,result{:});&lt;br&gt;
&lt;br&gt;
to get the permutations.&lt;br&gt;
&lt;br&gt;
best, arun.</description>
    </item>
    <item>
      <pubDate>Tue, 18 Aug 2009 12:36:19 -0400</pubDate>
      <title>Re: Permutations in matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258760#673961</link>
      <author>Matt Fig</author>
      <description>&quot;Midhun &quot; &amp;lt;midhunjoyp@gmail.com&amp;gt; wrote in message &amp;lt;h6dfju$juk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hello,&lt;br&gt;
&amp;gt;  How can I do permutations in matlab ? &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; In Matalb , the command :   ' combntns(set,subset)'  returns a matrix whose rows are the various combinations that can be taken of the elements of the vector set of length subset.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; How can I create a 'permutational' set instead of a 'combinatorial' set ?  &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
See, for example:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/24325&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/24325&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/11462&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/11462&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 18 Aug 2009 14:10:23 -0400</pubDate>
      <title>Re: Permutations in matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258760#673984</link>
      <author>Midhun </author>
      <description>&lt;br&gt;
Thanks a lot for the post...&lt;br&gt;
- Midhun</description>
    </item>
  </channel>
</rss>

