Cody

Solution 1163068

Submitted on 14 Apr 2017
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=2; m=5; S=1:10; y_correct =[1 2 3 4 5 6 7 8 9 10]; assert(isequal(ResHape(S,m,n),y_correct))

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

Assertion failed.

2   Fail
n=4; m=8; S=[1:10 6:12 5:19] y_correct=[ 1 2 3 4 5 6 7 8 9 10 6 7 8 9 10 11 12 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19] assert(isequal(ResHape(S,m,n),y_correct))

S = Columns 1 through 29 1 2 3 4 5 6 7 8 9 10 6 7 8 9 10 11 12 5 6 7 8 9 10 11 12 13 14 15 16 Columns 30 through 32 17 18 19 y_correct = 1 2 3 4 5 6 7 8 9 10 6 7 8 9 10 11 12 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 y = 1 5 9 8 12 8 12 16 2 6 10 9 5 9 13 17 3 7 6 10 6 10 14 18 4 8 7 11 7 11 15 19

Assertion failed.

3   Fail
n=2; m=31; S=[1:10 6:12 zeros(1,20) 5:19 ones(1,10)] y_correct=[1 2 3 4 5 6 7 8 9 10 6 7 8 9 10 11 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 1 1 1 1 1 1 1 1 1]; assert(isequal(ResHape(S,m,n),y_correct))

S = Columns 1 through 29 1 2 3 4 5 6 7 8 9 10 6 7 8 9 10 11 12 0 0 0 0 0 0 0 0 0 0 0 0 Columns 30 through 58 0 0 0 0 0 0 0 0 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 1 1 1 1 1 Columns 59 through 62 1 1 1 1 y = Columns 1 through 29 1 3 5 7 9 6 8 10 12 0 0 0 0 0 0 0 0 0 0 6 8 10 12 14 16 18 1 1 1 2 4 6 8 10 7 9 11 0 0 0 0 0 0 0 0 0 0 5 7 9 11 13 15 17 19 1 1 1 Columns 30 through 31 1 1 1 1

Assertion failed.