Cody

Problem 43656. Tent matrix

Solution 1991821

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

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 = 2 3 1 s = 3 1 2 s = 1 2 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 = 2 3 4 5 1 s = 3 4 5 1 2 s = 4 5 1 2 3 s = 5 1 2 3 4 s = 1 2 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 = 2 3 4 5 6 7 1 s = 3 4 5 6 7 1 2 s = 4 5 6 7 1 2 3 s = 5 6 7 1 2 3 4 s = 6 7 1 2 3 4 5 s = 7 1 2 3 4 5 6 s = 1 2 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 = 2 3 4 5 6 7 8 9 10 11 1 s = 3 4 5 6 7 8 9 10 11 1 2 s = 4 5 6 7 8 9 10 11 1 2 3 s = 5 6 7 8 9 10 11 1 2 3 4 s = 6 7 8 9 10 11 1 2 3 4 5 s = 7 8 9 10 11 1 2 3 4 5 6 s = 8 9 10 11 1 2 3 4 5 6 7 s = 9 10 11 1 2 3 4 5 6 7 8 s = 10 11 1 2 3 4 5 6 7 8 9 s = 11 1 2 3 4 5 6 7 8 9 10 s = 1 2 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))