Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How to these permutations?

1 Ansicht (letzte 30 Tage)
S. David
S. David am 27 Mai 2012
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hello,
Suppose I have a vector of N elements, and I need to find all possible permutations {N \choose n} for n=1,2, ..., N. How can I do that?
Example: Suppose I have the vector [1 2 3], then all possible permutations are: 123 (n=3), 12, 13, 23, (n=2), 1, 2, 3 (n=1)
Thanks
  2 Kommentare
Oleg Komarov
Oleg Komarov am 27 Mai 2012
doc nchoosek
S. David
S. David am 28 Mai 2012
I did not know it is built-in in MATLAB. Thanks

Antworten (1)

Junaid
Junaid am 27 Mai 2012
Take a look over this link. This might be useful for you.
  1 Kommentar
S. David
S. David am 28 Mai 2012
It is not working. I do not know why. I think choosek does the job. Thanks anyway

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by