Cody

Solution 1983099

Submitted on 20 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
m = 3; n = 5; s_correct = [1 12 11 10 9; 2 13 14 15 8; 3 4 5 6 7]; assert(isequal(spiralIn(m,n),s_correct))

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

Output argument "s" (and maybe others) not assigned during call to "spiralIn". Error in Test1 (line 4) assert(isequal(spiralIn(m,n),s_correct))

2   Fail
m = 5; n = 3; s_correct = [1 12 11; 2 13 10; 3 14 9; 4 15 8; 5 6 7]; assert(isequal(spiralIn(m,n),s_correct))

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

Output argument "s" (and maybe others) not assigned during call to "spiralIn". Error in Test2 (line 4) assert(isequal(spiralIn(m,n),s_correct))

3   Fail
m = 1; n = 1; s_correct = 1; assert(isequal(spiralIn(m,n),s_correct))

ans = 1

Output argument "s" (and maybe others) not assigned during call to "spiralIn". Error in Test3 (line 4) assert(isequal(spiralIn(m,n),s_correct))

4   Fail
m = 5; n = 0; s_correct = zeros(5,0); assert(isequal(spiralIn(m,n),s_correct))

ans = 0×5 empty double matrix

Output argument "s" (and maybe others) not assigned during call to "spiralIn". Error in Test4 (line 4) assert(isequal(spiralIn(m,n),s_correct))

5   Fail
m = 2; n = 2; s_correct = [1 4; 2 3]; assert(isequal(spiralIn(m,n),s_correct))

ans = 4 1 3 2

Output argument "s" (and maybe others) not assigned during call to "spiralIn". Error in Test5 (line 4) assert(isequal(spiralIn(m,n),s_correct))

Suggested Problems

More from this Author11