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