MATLAB: I am trying to implement this function so that it returns the sum of all the values in the m-by-n matrix A without using the buit in function sum
There are many ways to solve this coding problem. The most common way is to divide the spiral matrix into layers, find a pattern and accumulate the sum of 4 corners of each layer.
Best Answer