Cody

Problem 1035. Generate a vector like 1,2,2,3,3,3,4,4,4,4

Solution 2193839

Submitted on 5 Apr 2020 by Ishan Fernando
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
x = 2; y_correct = [1 2 2]; assert(isequal(your_fcn_name(x),y_correct))

y = 1 count = 1 pos = 2 y = 1 2 count = 1 pos = 3 y = 1 2 2 count = 2 pos = 4

2   Pass
x = 5; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5]; assert(isequal(your_fcn_name(x),y_correct))

y = 1 count = 1 pos = 2 y = 1 2 count = 1 pos = 3 y = 1 2 2 count = 2 pos = 4 y = 1 2 2 3 count = 1 pos = 5 y = 1 2 2 3 3 count = 2 pos = 6 y = 1 2 2 3 3 3 count = 3 pos = 7 y = 1 2 2 3 3 3 4 count = 1 pos = 8 y = 1 2 2 3 3 3 4 4 count = 2 pos = 9 y = 1 2 2 3 3 3 4 4 4 count = 3 pos = 10 y = 1 2 2 3 3 3 4 4 4 4 count = 4 pos = 11 y = 1 2 2 3 3 3 4 4 4 4 5 count = 1 pos = 12 y = 1 2 2 3 3 3 4 4 4 4 5 5 count = 2 pos = 13 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 count = 3 pos = 14 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 count = 4 pos = 15 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 count = 5 pos = 16

3   Pass
x = 10; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10]; assert(isequal(your_fcn_name(x),y_correct))

y = 1 count = 1 pos = 2 y = 1 2 count = 1 pos = 3 y = 1 2 2 count = 2 pos = 4 y = 1 2 2 3 count = 1 pos = 5 y = 1 2 2 3 3 count = 2 pos = 6 y = 1 2 2 3 3 3 count = 3 pos = 7 y = 1 2 2 3 3 3 4 count = 1 pos = 8 y = 1 2 2 3 3 3 4 4 count = 2 pos = 9 y = 1 2 2 3 3 3 4 4 4 count = 3 pos = 10 y = 1 2 2 3 3 3 4 4 4 4 count = 4 pos = 11 y = 1 2 2 3 3 3 4 4 4 4 5 count = 1 pos = 12 y = 1 2 2 3 3 3 4 4 4 4 5 5 count = 2 pos = 13 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 count = 3 pos = 14 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 count = 4 pos = 15 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 count = 5 pos = 16 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 count = 1 pos = 17 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 count = 2 pos = 18 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 count = 3 pos = 19 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 count = 4 pos = 20 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 count = 5 pos = 21 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 count = 6 pos = 22 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 count = 1 pos = 23 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 count = 2 pos = 24 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 count = 3 pos = 25 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 count = 4 pos = 26 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 count = 5 pos = 27 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 count = 6 pos = 28 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 count = 7 pos = 29 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 count = 1 pos = 30 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 count = 2 pos = 31 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Column 31 8 count = 3 pos = 32 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 32 8 8 count = 4 pos = 33 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 33 8 8 8 count = 5 pos = 34 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 34 8 8 8 8 count = 6 pos = 35 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 35 8 8 8 8 8 count = 7 pos = 36 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 36 8 8 8 8 8 8 count = 8 pos = 37 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 37 8 8 8 8 8 8 9 count = 1 pos = 38 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 38 8 8 8 8 8 8 9 9 count = 2 pos = 39 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 39 8 8 8 8 8 8 9 9 9 count = 3 pos = 40 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 40 8 8 8 8 8 8 9 9 9 9 count = 4 pos = 41 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 41 8 8 8 8 8 8 9 9 9 9 9 count = 5 pos = 42 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 42 8 8 8 8 8 8 9 9 9 9 9 9 count = 6 pos = 43 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 43 8 8 8 8 8 8 9 9 9 9 9 9 9 count = 7 pos = 44 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 44 8 8 8 8 8 8 9 9 9 9 9 9 9 9 count = 8 pos = 45 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 45 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 count = 9 pos = 46 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 46 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 count = 1 pos = 47 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 47 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 count = 2 pos = 48 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 48 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 count = 3 pos = 49 y = Columns 1 throu...

4   Pass
x = 12; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 ... 11 11 11 11 11 11 11 11 11 11 11 ... 12 12 12 12 12 12 12 12 12 12 12 12]; assert(isequal(your_fcn_name(x),y_correct))

y = 1 count = 1 pos = 2 y = 1 2 count = 1 pos = 3 y = 1 2 2 count = 2 pos = 4 y = 1 2 2 3 count = 1 pos = 5 y = 1 2 2 3 3 count = 2 pos = 6 y = 1 2 2 3 3 3 count = 3 pos = 7 y = 1 2 2 3 3 3 4 count = 1 pos = 8 y = 1 2 2 3 3 3 4 4 count = 2 pos = 9 y = 1 2 2 3 3 3 4 4 4 count = 3 pos = 10 y = 1 2 2 3 3 3 4 4 4 4 count = 4 pos = 11 y = 1 2 2 3 3 3 4 4 4 4 5 count = 1 pos = 12 y = 1 2 2 3 3 3 4 4 4 4 5 5 count = 2 pos = 13 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 count = 3 pos = 14 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 count = 4 pos = 15 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 count = 5 pos = 16 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 count = 1 pos = 17 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 count = 2 pos = 18 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 count = 3 pos = 19 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 count = 4 pos = 20 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 count = 5 pos = 21 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 count = 6 pos = 22 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 count = 1 pos = 23 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 count = 2 pos = 24 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 count = 3 pos = 25 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 count = 4 pos = 26 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 count = 5 pos = 27 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 count = 6 pos = 28 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 count = 7 pos = 29 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 count = 1 pos = 30 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 count = 2 pos = 31 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Column 31 8 count = 3 pos = 32 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 32 8 8 count = 4 pos = 33 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 33 8 8 8 count = 5 pos = 34 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 34 8 8 8 8 count = 6 pos = 35 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 35 8 8 8 8 8 count = 7 pos = 36 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 36 8 8 8 8 8 8 count = 8 pos = 37 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 37 8 8 8 8 8 8 9 count = 1 pos = 38 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 38 8 8 8 8 8 8 9 9 count = 2 pos = 39 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 39 8 8 8 8 8 8 9 9 9 count = 3 pos = 40 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 40 8 8 8 8 8 8 9 9 9 9 count = 4 pos = 41 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 41 8 8 8 8 8 8 9 9 9 9 9 count = 5 pos = 42 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 42 8 8 8 8 8 8 9 9 9 9 9 9 count = 6 pos = 43 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 43 8 8 8 8 8 8 9 9 9 9 9 9 9 count = 7 pos = 44 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 44 8 8 8 8 8 8 9 9 9 9 9 9 9 9 count = 8 pos = 45 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 45 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 count = 9 pos = 46 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 46 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 count = 1 pos = 47 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 47 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 count = 2 pos = 48 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 48 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 count = 3 pos = 49 y = Columns 1 throu...

5   Pass
x = 9; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9]; assert(isequal(your_fcn_name(x),y_correct))

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

6   Pass
x = 7; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7]; assert(isequal(your_fcn_name(x),y_correct))

y = 1 count = 1 pos = 2 y = 1 2 count = 1 pos = 3 y = 1 2 2 count = 2 pos = 4 y = 1 2 2 3 count = 1 pos = 5 y = 1 2 2 3 3 count = 2 pos = 6 y = 1 2 2 3 3 3 count = 3 pos = 7 y = 1 2 2 3 3 3 4 count = 1 pos = 8 y = 1 2 2 3 3 3 4 4 count = 2 pos = 9 y = 1 2 2 3 3 3 4 4 4 count = 3 pos = 10 y = 1 2 2 3 3 3 4 4 4 4 count = 4 pos = 11 y = 1 2 2 3 3 3 4 4 4 4 5 count = 1 pos = 12 y = 1 2 2 3 3 3 4 4 4 4 5 5 count = 2 pos = 13 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 count = 3 pos = 14 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 count = 4 pos = 15 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 count = 5 pos = 16 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 count = 1 pos = 17 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 count = 2 pos = 18 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 count = 3 pos = 19 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 count = 4 pos = 20 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 count = 5 pos = 21 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 count = 6 pos = 22 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 count = 1 pos = 23 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 count = 2 pos = 24 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 count = 3 pos = 25 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 count = 4 pos = 26 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 count = 5 pos = 27 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 count = 6 pos = 28 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 count = 7 pos = 29

7   Pass
x = 15; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 ... 11 11 11 11 11 11 11 11 11 11 11 ... 12 12 12 12 12 12 12 12 12 12 12 12 ... 13 13 13 13 13 13 13 13 13 13 13 13 13 ... 14 14 14 14 14 14 14 14 14 14 14 14 14 14 ... 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15]; assert(isequal(your_fcn_name(x),y_correct))

y = 1 count = 1 pos = 2 y = 1 2 count = 1 pos = 3 y = 1 2 2 count = 2 pos = 4 y = 1 2 2 3 count = 1 pos = 5 y = 1 2 2 3 3 count = 2 pos = 6 y = 1 2 2 3 3 3 count = 3 pos = 7 y = 1 2 2 3 3 3 4 count = 1 pos = 8 y = 1 2 2 3 3 3 4 4 count = 2 pos = 9 y = 1 2 2 3 3 3 4 4 4 count = 3 pos = 10 y = 1 2 2 3 3 3 4 4 4 4 count = 4 pos = 11 y = 1 2 2 3 3 3 4 4 4 4 5 count = 1 pos = 12 y = 1 2 2 3 3 3 4 4 4 4 5 5 count = 2 pos = 13 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 count = 3 pos = 14 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 count = 4 pos = 15 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 count = 5 pos = 16 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 count = 1 pos = 17 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 count = 2 pos = 18 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 count = 3 pos = 19 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 count = 4 pos = 20 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 count = 5 pos = 21 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 count = 6 pos = 22 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 count = 1 pos = 23 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 count = 2 pos = 24 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 count = 3 pos = 25 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 count = 4 pos = 26 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 count = 5 pos = 27 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 count = 6 pos = 28 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 count = 7 pos = 29 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 count = 1 pos = 30 y = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 count = 2 pos = 31 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Column 31 8 count = 3 pos = 32 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 32 8 8 count = 4 pos = 33 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 33 8 8 8 count = 5 pos = 34 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 34 8 8 8 8 count = 6 pos = 35 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 35 8 8 8 8 8 count = 7 pos = 36 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 36 8 8 8 8 8 8 count = 8 pos = 37 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 37 8 8 8 8 8 8 9 count = 1 pos = 38 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 38 8 8 8 8 8 8 9 9 count = 2 pos = 39 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 39 8 8 8 8 8 8 9 9 9 count = 3 pos = 40 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 40 8 8 8 8 8 8 9 9 9 9 count = 4 pos = 41 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 41 8 8 8 8 8 8 9 9 9 9 9 count = 5 pos = 42 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 42 8 8 8 8 8 8 9 9 9 9 9 9 count = 6 pos = 43 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 43 8 8 8 8 8 8 9 9 9 9 9 9 9 count = 7 pos = 44 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 44 8 8 8 8 8 8 9 9 9 9 9 9 9 9 count = 8 pos = 45 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 45 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 count = 9 pos = 46 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 46 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 count = 1 pos = 47 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 47 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 count = 2 pos = 48 y = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 Columns 31 through 48 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 count = 3 pos = 49 y = Columns 1 throu...

Suggested Problems

More from this Author17

Community Treasure Hunt

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

Start Hunting!