Generate permutations of numbers
1 次查看(过去 30 天)
显示 更早的评论
I am using this perms([0 1]) to generate permutations and its giving me the following result
1 0
0 1
I want it to generate the all possible combinations e.g
1 1
1 0
0 1
0 0
i also used nchoosek([0 1],2) but i got
0 1
I want to generate similar type of combinations for 5 variables (1,2,3,4,5) where the range include 4 numbers.e.g
1 1 1 1 1
1 1 1 1 2
1 1 1 1 3 ...... It would be total of 4^5 = 1024 unique combinations. Thanks
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Special Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!