Cody

# Problem 42845. generate number in particular way

Solution 1932170

Submitted on 12 Sep 2019
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   Fail
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 ans = 2 2 2 2 2 ans = 3 3 ans = 4 4 4 4 4 4 4

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test1 (line 5) assert(isequal(your_fcn_name(a,m),y_correct))

2   Fail
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 ans = 2 2 2 ans = 3 3 ans = 4 4 4 4 4 4 4 ans = 5 5 5 5 ans = 6 6 6 6 6 6

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test2 (line 5) assert(isequal(your_fcn_name(a,m),y_correct))

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

ans = 1 ans = 2 ans = 3 ans = 4 ans = 5 ans = 6 ans = 7 ans = 8 ans = 9 ans = 10 ans = 11 ans = 12 ans = 13 ans = 14 ans = 15 ans = 16 ans = 17 ans = 18 ans = 19 ans = 20 ans = 21 ans = 22 ans = 23 ans = 24 ans = 25 ans = 26 ans = 27 ans = 28 ans = 29 ans = 30 ans = 31 ans = 32 ans = 33 ans = 34 ans = 35 ans = 36 ans = 37 ans = 38 ans = 39 ans = 40 ans = 41 ans = 42 ans = 43 ans = 44 ans = 45 ans = 46 ans = 47 ans = 48 ans = 49 ans = 50 ans = 51 ans = 52 ans = 53 ans = 54 ans = 55 ans = 56 ans = 57 ans = 58 ans = 59 ans = 60 ans = 61 ans = 62 ans = 63 ans = 64 ans = 65 ans = 66 ans = 67 ans = 68 ans = 69 ans = 70 ans = 71 ans = 72 ans = 73 ans = 74 ans = 75 ans = 76 ans = 77 ans = 78 ans = 79 ans = 80 ans = 81 ans = 82 ans = 83 ans = 84 ans = 85 ans = 86 ans = 87 ans = 88 ans = 89 ans = 90 ans = 91 ans = 92 ans = 93 ans = 94 ans = 95 ans = 96 ans = 97 ans = 98 ans = 99 ans = 100

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test3 (line 5) assert(isequal(your_fcn_name(a,m),y_correct))

4   Fail
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 ans = 2 ans = 3 3 ans = 4 4 4 4 4 4 ans = 5

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test4 (line 5) assert(isequal(your_fcn_name(a,m),y_correct))

5   Fail
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 ans = 2 2 ans = 3 3 3 ans = 4 4 4 4 ans = 5 5 5 5 5 ans = 6 6 6 6 6 6 ans = 7 7 7 7 7 7 7 ans = 8 8 8 8 8 8 8 8 ans = 9 9 9 9 9 9 9 9 9 ans = 10 10 10 10 10 10 10 10 10 10

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test5 (line 5) assert(isequal(your_fcn_name(a,m),y_correct))

6   Fail
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 ans = 2 ans = 3 3 3 3 ans = 4 ans = 5 5 5 5 5 ans = 6 6

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test6 (line 5) assert(isequal(your_fcn_name(a,m),y_correct))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!