Sum of array elements at 45° degree oblique dimension in Matlab

1 view (last 30 days)
Hello everyone!
I need your help!
Can anyone tell me how to find the sums (in red) of magic(3) array elements at 45° degree oblique dimension in Matlab as shown in the following figure ?

Accepted Answer

Steven Lord
Steven Lord on 29 Sep 2016
Use the diag function.

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!