How to make combinations of given condition?
Ältere Kommentare anzeigen
Hi, all,
For example, if I want to make all combination of 5-dim vectors have only 2 two's, other entries are all 0. Is there a command in Matlab can do it? That is 22000 20200 20020 20002 02200 02020 02002 00220 00202 00022
Thanks.
Akzeptierte Antwort
Weitere Antworten (1)
Roger Stafford
am 28 Dez. 2012
0 Stimmen
This is a problem for matlab's 'nchoosek' function.
1 Kommentar
C Zeng
am 1 Jan. 2013
Kategorien
Mehr zu Whos finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!