Problem 314. Find the sum of the elements in the "second" diagonal
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
Show
1 older comment
@bmtran (Bryant Tran)
on 12 Feb 2012
you might want to make a case that's not a magic square, considering the properties of the diagonals of a magic square...
Gaik Tamazian
on 17 Feb 2012
There are only magic squares in test cases, however the problem doesn't specify a type of the matrix.
David Young
on 1 Mar 2012
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.
Kye Taylor
on 7 Apr 2012
The "antidiagonal" is cooler sounding than "second diagonal"
Solution Comments
Show commentsProblem Recent Solvers1141
Suggested Problems
-
645 Solvers
-
Number of 1s in a binary string
8575 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
371 Solvers
-
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
936 Solvers
-
978 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!