Search code examples
matlabcellsequencecombinations

Matlab: Get all combination of a sequence?


I have a sequence like:{1,2,3}, I want to get all combination of it like: {{},{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}} Thank you.


Solution

  • Try with this: http://www.mathworks.com/help/stats/combnk.html. I believe you need combs, not perms.