Hello,
I've been searching for a function that give all permutations of c elements in 
n, as "combnk" Matlab function.
I fund in this forum 
http://octave.1599824.n4.nabble.com/combinations-td1636272.html a solution 
using "perms" function.
However, "perms" function sets a matrix of prod(2:n) line, which limits the use 
to n=10;

I tried an empiric algorithme, that can replace the use of "unique(sort (perms 
(1:n)(:,1:c), 2), 'rows')"
I am not a mathematician, and not even a programmer, but this code may inspire 
someone for a "clean" code.


Martin

Attachment: perms_mec.m
Description: Binary data

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to