Dispositions with repetitions; dispositions without repetitions; combinations with repetitions.
11 views (last 30 days)
Show older comments
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
Accepted Answer
Jan
on 18 Sep 2011
Assuming that you want "permutation", there are some corresponding functions in the FEX:
- Combinator
- Fas C-Mex implementations: VChooseKO, VChooseKR, VChooseKRO, VChooseK
More Answers (0)
See Also
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!