how to generate all possible combination from a sequence
Ältere Kommentare anzeigen
how to generate all possible combination from a n-dimensional vector without repetition of numbers.. i wanted combination of vec = 1:11;
eg:
vec = [1 2 3]
result = [
1 2 3;
1 3 2;
2 3 1;
2 1 3;
3 2 1;
3 1 2];
1 Kommentar
Your question is erroneous: these are not the combinations of vec, but are actually the permutations.
The difference is very simple:
- if the order does not matter: combinations.
- if the order is important: permutations.
You should make a complaint to your high school that they did not teach these basic mathematical terms correctly. Ask for your money back!
Akzeptierte Antwort
Weitere Antworten (1)
Jos (10584)
am 30 Mai 2016
1 Stimme
Kategorien
Mehr zu Elementary Math 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!