Rank: 43575 based on 0 downloads (last 30 days) and 0 file submitted
photo

almacellesiti Fernandez

E-mail

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by almacellesiti Fernandez
Updated File Comments Rating
22 Jun 2010 COMBINATOR -combinations AND permutations Returns 1 of 4 different samplings on the set 1:N, taken K at a time. Author: Matt Fig

Nice one Matt.

There might be a small problem though. With matlab 2009 in windows and matlab 2008 in linux I can reproduce the following problem.

combinator(24,23,'c')

leaves the last row of the return matrix to zeros. It does not update it because the parameter

BC=prod(M-K+1:M) / (prod(1:K));

inside the function function CN = combs_no_rep(N,K), at the line 343 of combinator.m

results in BC=23.999999999999996 (instead of the correct value, 24)

I guess a round in that line will take care of it.
A few other combinations of numbers give no problem.

Contact us