Dispositions with repetitions; dispositions without repetitions; combinations with repetitions.

10 views (last 30 days)
Good morning,
I use Matlab version 7.9 ; I already know the functions nchoosek(v,k) or combnk(v,k) to generate vectors of k components taking all the possible combinations without repetitions of k components among the n components of the vector v.
Now I need to do the same thing to generate vectors of k components:
  • taking all the possible combinations with repetitions of k components among the n components of the vector v;
  • taking all the possible dispositions without repetitions of k components among the n components of the vector v;
  • taking all the possible dispositions with repetitions of k components among the n components of the vector v.
Are there any functions for doing these things? If not, it is possible to do these things writing a short m-file?
Thank you.
Bussoli Lorenzo (Ph.d student in mathematics at the university of Florence).
  3 Comments
Lorenzo
Lorenzo on 20 Sep 2011
Sorry, I wrote the wrong word: I meant exactly "permutations" (that are combinations but considering the order); I wrongly wrote "dispositions" because in italian we call them "disposizioni".
Lorenzo Bussoli

Sign in to comment.

Accepted Answer

Jan
Jan on 18 Sep 2011
Assuming that you want "permutation", there are some corresponding functions in the FEX:
  1 Comment
Lorenzo
Lorenzo on 20 Sep 2011
Thanks very much Jan Simon, this is what I was looking for; in the question I wrote the wrong word "disposition" when I wanted to say "permutations"; the reason was because in italian we call them "disposizioni".
Lorenzo Bussoli

Sign in to comment.

More Answers (0)

Categories

Find more on Genomics and Next Generation Sequencing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!