Cody

Solution 1864360

Submitted on 3 Jul 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   Pass
% trivial x = 1; y_correct = 1; assert(isequal(mshuffle(x),y_correct))

y = 1

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

y = 5 3 1 2 4

Assertion failed.

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));

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

Assertion failed.

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

y = 1 3 5 7 6 4 2

Assertion failed.