Problem 46105. Find sum of numbers on the cornice of a matrix.
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
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers55
Suggested Problems
-
Determine whether a vector is monotonically increasing
22786 Solvers
-
Change the first and last diagonal element of the identity matrix to zero
158 Solvers
-
Remove All elements less than 5
142 Solvers
-
193 Solvers
-
multiply an array by its position number
111 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!