Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers1207
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15815 Solvers
-
Maximum running product for a string of numbers
2258 Solvers
-
361 Solvers
-
Determine if a Given Number is a Triangle Number
400 Solvers
-
Is my wife right? Now with even more wrong husband
1348 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
you might want to make a case that's not a magic square, considering the properties of the diagonals of a magic square...
There are only magic squares in test cases, however the problem doesn't specify a type of the matrix.
You should definitely strengthen the test suite. Lots of solutions rely on both diagonals being the same, even though this is not a property of the stated problem.
The "antidiagonal" is cooler sounding than "second diagonal"