Cody

Solution 2159804

Submitted on 14 Mar 2020
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
% trivial x = 1; y_correct = 1; assert(isequal(mshuffle(x),y_correct))

x = 1 ans = 1

Output argument "y" (and maybe others) not assigned during call to "mshuffle". Error in Test1 (line 4) assert(isequal(mshuffle(x),y_correct))

2   Fail
x = 1:5; y_correct = [4 2 1 3 5]; assert(isequal(mshuffle(x),y_correct))

s = 2 0 0 0 1 s = 2 4 0 3 1 x = 5 4 3 2 1 ans = 4 2 1 3 5

Output argument "y" (and maybe others) not assigned during call to "mshuffle". Error in Test2 (line 3) assert(isequal(mshuffle(x),y_correct))

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

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

Output argument "y" (and maybe others) not assigned during call to "mshuffle". Error in Test3 (line 4) assert(isequal(mshuffle(a),y_correct));

4   Fail
x = 7:-1:1; y_correct = [2 4 6 7 5 3 1]; assert(isequal(mshuffle(x),y_correct))

s = 2 0 0 0 0 0 1 s = 2 4 0 0 0 3 1 s = 2 4 6 0 5 3 1 x = 1 2 3 4 5 6 7 ans = 2 4 6 7 5 3 1

Output argument "y" (and maybe others) not assigned during call to "mshuffle". Error in Test4 (line 3) assert(isequal(mshuffle(x),y_correct))