Permutation and combination
显示 更早的评论
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
回答(1 个)
Jan
2011-10-21
0 个投票
This FEX submission solves the main part of your porblem:
类别
在 帮助中心 和 File Exchange 中查找有关 Elementary Math 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!