Cody

Solution 1814024

Submitted on 13 May 2019 by tony danial
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   Pass
x = [1]; y_correct = [0 0 0 0 1 0 0 0 0]; assert(isequal(zeroWrap(x),y_correct))

y = 1 0 0 0 0 1 0 0 0 0

2   Pass
x = randi(10,4,5); m=zeroWrap(x); assert(isequal(m(2:end-1,2:end-1),x))

y = 3 2 2 6 4 7 1 6 3 6 4 7 2 8 5 3 4 5 7 3 0 0 0 0 0 0 0 0 3 2 2 6 4 0 0 7 1 6 3 6 0 0 4 7 2 8 5 0 0 3 4 5 7 3 0 0 0 0 0 0 0 0

3   Pass
x = randi(10,4,5); m=zeroWrap(x); assert(isequal(sum(m(1,:)),0))

y = 9 3 6 3 7 10 3 7 8 2 8 10 10 7 1 6 5 2 1 3 0 0 0 0 0 0 0 0 9 3 6 3 7 0 0 10 3 7 8 2 0 0 8 10 10 7 1 0 0 6 5 2 1 3 0 0 0 0 0 0 0 0

4   Pass
x = randi(10,4,5); m=zeroWrap(x); assert(isequal(sum(m(end,:)),0))

y = 9 6 8 5 5 2 7 6 1 8 9 9 4 2 1 9 9 2 9 8 0 0 0 0 0 0 0 0 9 6 8 5 5 0 0 2 7 6 1 8 0 0 9 9 4 2 1 0 0 9 9 2 9 8 0 0 0 0 0 0 0 0

5   Pass
x = randi(10,4,5); m=zeroWrap(x); assert(isequal(sum(m(:,1)),0))

y = 8 1 9 9 9 1 4 9 10 5 5 4 2 6 4 3 5 9 1 8 0 0 0 0 0 0 0 0 8 1 9 9 9 0 0 1 4 9 10 5 0 0 5 4 2 6 4 0 0 3 5 9 1 8 0 0 0 0 0 0 0 0

6   Pass
x = randi(10,4,5); m=zeroWrap(x); assert(isequal(sum(m(:,end)),0))

y = 3 6 10 10 2 1 4 8 5 9 2 6 4 9 9 5 1 4 4 2 0 0 0 0 0 0 0 0 3 6 10 10 2 0 0 1 4 8 5 9 0 0 2 6 4 9 9 0 0 5 1 4 4 2 0 0 0 0 0 0 0 0

7   Pass
x = randi(10,4,5); m=zeroWrap(x); assert(isequal(size(m)-2,size(x)))

y = 7 7 2 3 8 3 4 2 9 1 7 7 2 3 8 5 5 6 10 3 0 0 0 0 0 0 0 0 7 7 2 3 8 0 0 3 4 2 9 1 0 0 7 7 2 3 8 0 0 5 5 6 10 3 0 0 0 0 0 0 0 0