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

Solution 19740

Submitted on 31 Jan 2012 by S L

Correct

104Size
Leading solution size is 14.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
x = 2;
y = [1;0;1;1;0;1;1];
assert(isequal(soroban_set(x),y))

                    
2
Pass
 
%%
x = 10586;
y = [ 1 1 0 0 0
      0 0 1 1 1
      1 0 0 1 1
      0 1 1 1 0
      1 1 1 1 1
      1 1 1 0 1
      1 1 1 1 1 ];
assert(isequal(soroban_set(x),y))

                    
3
Pass
 
%%
x = 0;
y = [ 1
      0
      0
      1
      1
      1
      1 ];
assert(isequal(soroban_set(x),y))

                    
4
Pass
 
%%
x = 50000;
y = [ 0 1 1 1 1
      1 0 0 0 0
      0 0 0 0 0
      1 1 1 1 1
      1 1 1 1 1
      1 1 1 1 1
      1 1 1 1 1 ];
assert(isequal(soroban_set(x),y))

                    
5
Pass
 
%%
x = 9876543210;
y = [ 0 0 0 0 0 1 1 1 1 1
      1 1 1 1 1 0 0 0 0 0
      1 1 1 1 0 1 1 1 1 0
      1 1 1 0 1 1 1 1 0 1
      1 1 0 1 1 1 1 0 1 1
      1 0 1 1 1 1 0 1 1 1
      0 1 1 1 1 0 1 1 1 1 ];
assert(isequal(soroban_set(x),y))