0

Is there a way to use the nchoosek function(or any other function for that matter) to get all combinations of 0 and 1 on a length n?

Ideally I would want a matrix so when i use this function with length 2, it would display this.

ans =

 0     0
 0     1
 1     0
 1     1
Wolfie
  • 27,562
  • 7
  • 28
  • 55
Anderpot
  • 1
  • 1

0 Answers0