Cody

Solution 1991819

Submitted on 26 Oct 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
n = 1; y_correct = 1; assert(isequal(surround(n),y_correct))

s = 1 s = 1×0 empty double row vector s = 1×0 empty double row vector

Output argument "y" (and maybe others) not assigned during call to "surround". Error in Test1 (line 3) assert(isequal(surround(n),y_correct))

2   Fail
n=3 y_correct = [1 2 1 2 3 2 1 2 1]; assert(isequal(surround(n),y_correct))

n = 3 s = 1 2 3 s = 2 3 s = 3

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

3   Fail
n=5 y_correct = [1 2 3 2 1 2 3 4 3 2 3 4 5 4 3 2 3 4 3 2 1 2 3 2 1]; assert(isequal(surround(n),y_correct))

n = 5 s = 1 2 3 4 5 s = 2 3 4 5 s = 3 4 5

Output argument "y" (and maybe others) not assigned during call to "surround". Error in Test3 (line 7) assert(isequal(surround(n),y_correct))

4   Fail
n=7 y_correct = [1 2 3 4 3 2 1 2 3 4 5 4 3 2 3 4 5 6 5 4 3 4 5 6 7 6 5 4 3 4 5 6 5 4 3 2 3 4 5 4 3 2 1 2 3 4 3 2 1]; assert(isequal(surround(n),y_correct))

n = 7 s = 1 2 3 4 5 6 7 s = 2 3 4 5 6 7 s = 3 4 5 6 7

Output argument "y" (and maybe others) not assigned during call to "surround". Error in Test4 (line 9) assert(isequal(surround(n),y_correct))

5   Fail
n=11 y_correct = [ 1 2 3 4 5 6 5 4 3 2 1 2 3 4 5 6 7 6 5 4 3 2 3 4 5 6 7 8 7 6 5 4 3 4 5 6 7 8 9 8 7 6 5 4 5 6 7 8 9 10 9 8 7 6 5 6 7 8 9 10 11 10 9 8 7 6 5 6 7 8 9 10 9 8 7 6 5 4 5 6 7 8 9 8 7 6 5 4 3 4 5 6 7 8 7 6 5 4 3 2 3 4 5 6 7 6 5 4 3 2 1 2 3 4 5 6 5 4 3 2 1]; assert(isequal(surround(n),y_correct))

n = 11 s = 1 2 3 4 5 6 7 8 9 10 11 s = 2 3 4 5 6 7 8 9 10 11 s = 3 4 5 6 7 8 9 10 11

Output argument "y" (and maybe others) not assigned during call to "surround". Error in Test5 (line 13) assert(isequal(surround(n),y_correct))

Suggested Problems

More from this Author1