Cody

# Problem 1433. Mirror Image matrix across anti-diagonal

Solution 1707179

Submitted on 15 Jan 2019 by Nikolaos Nikolaou
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
x = 3; y_correct = [1 2 3;2 3 2; 3 2 1]; assert(isequal(mirror_anti_diag(x),y_correct))

n = 4 B = 0 0 0 0 0 0 0 0 0 i = 1 t = 3 3 3 A = 3 0 0 0 3 0 0 0 3 B = 3 0 0 0 3 0 0 0 3 t = 2 2 A = 0 2 0 0 0 2 0 0 0 B = 3 2 0 0 3 2 0 0 3 t = 1 A = 0 0 1 0 0 0 0 0 0 B = 3 2 1 0 3 2 0 0 3 B = 6 2 1 2 6 2 1 2 6 B = 3 2 1 2 6 2 1 2 6 B = 3 2 1 2 3 2 1 2 6 B = 3 2 1 2 3 2 1 2 3 Y = 1 2 3 2 3 2 3 2 1

2   Pass
x = 1; y_correct = [1]; assert(isequal(mirror_anti_diag(x),y_correct))

n = 2 B = 0 i = 1 t = 1 A = 1 B = 1 B = 2 B = 1 Y = 1

3   Pass
x = 4; y_correct = [1 2 3 4; 2 3 4 3; 3 4 3 2; 4 3 2 1 ]; assert(isequal(mirror_anti_diag(x),y_correct))

n = 5 B = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 i = 1 t = 4 4 4 4 A = 4 0 0 0 0 4 0 0 0 0 4 0 0 0 0 4 B = 4 0 0 0 0 4 0 0 0 0 4 0 0 0 0 4 t = 3 3 3 A = 0 3 0 0 0 0 3 0 0 0 0 3 0 0 0 0 B = 4 3 0 0 0 4 3 0 0 0 4 3 0 0 0 4 t = 2 2 A = 0 0 2 0 0 0 0 2 0 0 0 0 0 0 0 0 B = 4 3 2 0 0 4 3 2 0 0 4 3 0 0 0 4 t = 1 A = 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 B = 4 3 2 1 0 4 3 2 0 0 4 3 0 0 0 4 B = 8 3 2 1 3 8 3 2 2 3 8 3 1 2 3 8 B = 4 3 2 1 3 8 3 2 2 3 8 3 1 2 3 8 B = 4 3 2 1 3 4 3 2 2 3 8 3 1 2 3 8 B = 4 3 2 1 3 4 3 2 2 3 4 3 1 2 3 8 B = 4 3 2 1 3 4 3 2 2 3 4 3 1 2 3 4 Y = 1 2 3 4 2 3 4 3 3 4 3 2 4 3 2 1