Find sum of numbers on the cornice of a matrix. - MATLAB Cody - MATLAB Central

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

Difficulty:Rate
Given a matrix of random integers, calculate the sum of all the integers in the cornice of the matrix.
For example if MTX = [ 1 3 5 6;
4 7 9 2;
5 6 1 3;
7 9 2 1]
output = 1 + 3 + 5 + 6 + 4 + 2 + 5 + 3 + 7 + 9 + 2 + 1 = 48

Solution Stats

62.89% Correct | 37.11% Incorrect
Last Solution submitted on Jun 24, 2025

Problem Comments

Solution Comments

Show comments
MATLAB EXPO 2025 Registration is Now Open! November 12 – 13, 2025
Registration is now open for MathWorks annual virtual event MATLAB EXPO 2025...
0
0

Problem Recent Solvers55

Suggested Problems

Community Treasure Hunt

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

Start Hunting!