Problem 1488. Generate binary combinations for a given number of bit(s)
Generate the binary combination as in the example below.
Example: If you are given:
bin_comb(2)
The answer will be:
0 0 0 1 1 0 1 1
The answer will appear in double class.
Solution Stats
Problem Comments
-
5 Comments
Show
2 older comments
Claudio Gelmi
on 4 May 2013
y_correct of Test case #1 is wrong; it requires [ ].
Richard Zapor
on 4 May 2013
Case 1: [0;1]
andrea84
on 5 May 2013
test case 1 should be [0;1] ?
Ned Gulley
on 6 May 2013
I cleaned up the problem statement and fixed the first test.
Claudio Gelmi
on 7 May 2013
Thanks!
Solution Comments
Show commentsProblem Recent Solvers95
Suggested Problems
-
Swap the first and last columns
22361 Solvers
-
Remove any row in which a NaN appears
8755 Solvers
-
Least common multiple of many numbers
253 Solvers
-
Rotate input square matrix 90 degrees CCW without rot90
673 Solvers
-
Detect a number and replace with two NaN's
199 Solvers
More from this Author16
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!