Cody

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

46.24% Correct | 53.76% Incorrect
Last solution submitted on Nov 07, 2016

Problem Comments

Solution Comments

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more