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 207581

Submitted on 22 Feb 2013 by andrea84

Correct

38Size
Leading solution size is 11.
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
 
%%
t1=1; r=1; n=7;
y_correct = 7;
assert(isequal(your_fcn_name(t1,r,n),y_correct))
num =
     1
num =
     1     1
num =
     1     1     1
num =
     1     1     1     1
num =
     1     1     1     1     1
num =
     1     1     1     1     1     1
num =
     1     1     1     1     1     1     1
y =
     7
2
Pass
 
%%
t1=10; r=10; n=5;
y_correct = 111110;
assert(isequal(your_fcn_name(t1,r,n),y_correct))
num =
    10
num =
    10   100
num =
          10         100        1000
num =
          10         100        1000       10000
num =
          10         100        1000       10000      100000
y =
      111110
3
Pass
 
%%
t1=7; r=3; n=5;
y_correct = 847;
assert(isequal(your_fcn_name(t1,r,n),y_correct))
num =
     7
num =
     7    21
num =
     7    21    63
num =
     7    21    63   189
num =
     7    21    63   189   567
y =
   847