Cody

Solution 1720204

Submitted on 4 Feb 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=[3 2 4 1]; assert(isequal(spiralmatrix(x),y_correct))

y = 4 3 1 2

Assertion failed.

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

y = 5 4 3 6 1 2 7 8 9

Assertion failed.

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

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

Assertion failed.

4   Fail
x=5; y_correct=[21 20 19 18 17 22 7 6 5 16 23 8 1 4 15 24 9 2 3 14 25 10 11 12 13]; assert(isequal(spiralmatrix(x),y_correct))

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

Assertion failed.

Suggested Problems