Cody

Problem 2204. Convert a vector of Integers into a matrix of binaries

Convert a vector of positive integers into a matrix containing their binary representation. Each column of the output contains the binary representation. The least significant bit is at the top.

Example

 input  = [1 2 3 4]
 output = [1 0 1 0
           0 1 1 0
           0 0 0 1]

Solution Stats

50.67% Correct | 49.33% Incorrect
Last solution submitted on Aug 31, 2016
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