Permutation and combination
Ältere Kommentare anzeigen
Hi all, I am trying to solve a problem. I need a matlab code which automatically calculates the possible number of combinations of dividing a number or constant to eg 3 objects using a defined step.
eg to divide 60 to A, B, C using step size 60. Possibilities will be [60 0 0; 0 60 0; 0 0 60] --> 3 possible combinations
120 using step 60, will be [120 0 0; 0 120 0; 0 0 120; 60 60 0; 60 0 60; 0 60 60] --> 6 possible combinations ... and so on
Can anyone help me with a matlab code which computes these possible number of combinations? I will be very grateful. Hummy
Antworten (1)
Jan
am 21 Okt. 2011
0 Stimmen
This FEX submission solves the main part of your porblem:
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!