Cody

Solution 1799691

Submitted on 29 Apr 2019 by Michal Belorit
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
a = [1 5 2 7]; m = 10; y_correct = [1 2 2 2 2 2 3 3 4 4]; assert(isequal(your_fcn_name(a,m),y_correct))

ans = 1 2 2 2 2 2 3 3 4 4

2   Pass
a = [2 3 2 7 4 6]; m = 22; y_correct = [1 1 2 2 2 3 3 4 4 4 4 4 4 4 5 5 5 5 6 6 6 6]; assert(isequal(your_fcn_name(a,m),y_correct))

ans = 1 1 2 2 2 3 3 4 4 4 4 4 4 4 5 5 5 5 6 6 6 6

3   Pass
a = ones(1,100); m = 42; y_correct = 1:42; assert(isequal(your_fcn_name(a,m),y_correct))

ans = Columns 1 through 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Columns 31 through 42 31 32 33 34 35 36 37 38 39 40 41 42

4   Pass
a = [3 1 2 6 1]; m = 13; y_correct = [1 1 1 2 3 3 4 4 4 4 4 4 5]; assert(isequal(your_fcn_name(a,m),y_correct))

ans = 1 1 1 2 3 3 4 4 4 4 4 4 5

5   Pass
a = 1:10; m = 20; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6]; assert(isequal(your_fcn_name(a,m),y_correct))

ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6

6   Pass
a = [3 1 4 1 5 2]; m = 13; y_correct = [1 1 1 2 3 3 3 3 4 5 5 5 5]; assert(isequal(your_fcn_name(a,m),y_correct))

ans = 1 1 1 2 3 3 3 3 4 5 5 5 5

Suggested Problems

More from this Author3