Cody

# Problem 46105. Find sum of numbers on the cornice of a matrix.

Solution 3069601

Submitted on 5 Oct 2020 by Binbin Qi
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
MTX = [ 1 3 5 6; 4 7 9 2; 5 6 1 3; 7 9 2 1]; y_correct = 48; assert(isequal(sumCornice(MTX),y_correct))

2   Pass
MTX = [ 7 1 7 4 5 4 3 3 7 6 6 1 9 8 7 2 1 1 2 7 7 8 4 5 3]; y_correct = 83; assert(isequal(sumCornice(MTX),y_correct))

3   Pass
MTX = [ 7 2 6 2]; y_correct = 17; assert(isequal(sumCornice(MTX),y_correct))

4   Pass
MTX = [ 5 7 3 5 7 2 5 1 9 9 8 4 4 6 2 3 4 9 3 8 6 5 6 9 6 5 9 6 1 1 3 2 3 2 4 5 1 4 6 8 7 2 2 9 5 2 7 5 3 3 3 3 8 8 7 9 5 8 6 7 9 3 5 1]; y_correct = 147; assert(isequal(sumCornice(MTX),y_correct))

5   Pass
MTX = [ 4 8 9 6 5 3 1 1 2 5 4 4 9 4 3 2 1 1 1 3 2 8 3 9 7 8 2 6 2 9 8 4 8 4 2 5]; y_correct = 107; assert(isequal(sumCornice(MTX),y_correct))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!