Cody

Solution 1880122

Submitted on 21 Jul 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
x = 2; y_correct = [1 2 2]; assert(isequal(your_fcn_name(x),y_correct))

Array indices must be positive integers or logical values. Error in your_fcn_name (line 3) ans(1,(1+a(a-1)/2):a*(a+1)/2) = a; Error in Test1 (line 3) assert(isequal(your_fcn_name(x),y_correct))

2   Fail
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))

Array indices must be positive integers or logical values. Error in your_fcn_name (line 3) ans(1,(1+a(a-1)/2):a*(a+1)/2) = a; Error in Test2 (line 3) assert(isequal(your_fcn_name(x),y_correct))

3   Fail
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))

Array indices must be positive integers or logical values. Error in your_fcn_name (line 3) ans(1,(1+a(a-1)/2):a*(a+1)/2) = a; Error in Test3 (line 5) assert(isequal(your_fcn_name(x),y_correct))

4   Fail
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))

Array indices must be positive integers or logical values. Error in your_fcn_name (line 3) ans(1,(1+a(a-1)/2):a*(a+1)/2) = a; Error in Test4 (line 7) assert(isequal(your_fcn_name(x),y_correct))

5   Fail
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))

Array indices must be positive integers or logical values. Error in your_fcn_name (line 3) ans(1,(1+a(a-1)/2):a*(a+1)/2) = a; Error in Test5 (line 5) assert(isequal(your_fcn_name(x),y_correct))

6   Fail
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))

Array indices must be positive integers or logical values. Error in your_fcn_name (line 3) ans(1,(1+a(a-1)/2):a*(a+1)/2) = a; Error in Test6 (line 4) assert(isequal(your_fcn_name(x),y_correct))

7   Fail
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))

Array indices must be positive integers or logical values. Error in your_fcn_name (line 3) ans(1,(1+a(a-1)/2):a*(a+1)/2) = a; Error in Test7 (line 10) assert(isequal(your_fcn_name(x),y_correct))