Cody

Solution 1942855

Submitted on 19 Sep 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
A = magic(5); y_correct = [10 12 19 21 3; 11 18 25 2 9; 17 24 1 8 15; 23 5 7 14 16; 4 6 13 20 22]; assert(isequal(your_fcn_name(A),y_correct))

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

Assertion failed.

2   Fail
A = 1:5; y_correct = A; assert(isequal(your_fcn_name(A),y_correct))

ans = 1

Assertion failed.

3   Fail
A = [1:4; 9:12; 13:16; 5:8]; y_correct = reshape((1:16),[4,4])'; assert(isequal(your_fcn_name(A),y_correct))

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

Assertion failed.

4   Fail
A = (1:10)'; y_correct = A; ind = rand(10,1); [~,indA] = sort(ind); A = A(indA); assert(isequal(your_fcn_name(A),y_correct))

Index in position 2 exceeds array bounds (must not exceed 1). Error in your_fcn_name (line 3) A(:,i) Error in Test4 (line 4) assert(isequal(your_fcn_name(A),y_correct))

5   Fail
A = [3:7; 10:-1:6; -4:0; 2:-1:-2]; y_correct = flipud(A); assert(isequal(your_fcn_name(A),y_correct))

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

Assertion failed.