Cody

Solution 1608983

Submitted on 14 Aug 2018 by Ben Cappello
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 = ones(2); y_correct = 4; assert(isequal(sumDiagonalElements(x),y_correct))

a = 2 b = 2 y = 4 aa = 1

2   Pass
x = ones(3); y_correct = 5; assert(isequal(sumDiagonalElements(x),y_correct))

a = 3 b = 3 y = 6 aa = 1 y = 5

3   Pass
x = magic(8); y_correct = 520; assert(isequal(sumDiagonalElements(x),y_correct))

a = 260 b = 260 y = 520 aa = 37

4   Pass
x = magic(9); y_correct = 697; assert(isequal(sumDiagonalElements(x),y_correct))

a = 369 b = 369 y = 738 aa = 41 y = 697