Cody

# Problem 43653. Flipping a Matrix

Solution 1051725

Submitted on 13 Nov 2016
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
Mat = [1 2 3; 4 5 6; 7 8 9]; A_correct = [7 8 9; 4 5 6; 1 2 3] assert(isequal(Filping(Mat),A_correct))

A_correct = 7 8 9 4 5 6 1 2 3 x = 1 2 3 A = 1 2 3 4 5 6 7 8 9 A = 7 8 9 4 5 6 7 8 9 A = 7 8 9 4 5 6 1 2 3

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

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

Assertion failed.

3   Pass
Mat = eye(2,3) A_correct = [0 1 0;1 0 0] assert(isequal(Filping(Mat),A_correct))

Mat = 1 0 0 0 1 0 A_correct = 0 1 0 1 0 0 x = 1 0 0 A = 1 0 0 0 1 0 A = 0 1 0 0 1 0 A = 0 1 0 1 0 0