MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply TodayGiven a matrix, return the sum of all the elements across the diagonals.

E.g. A = [1 2 3; 4 5 6; 7 8 9;]

then, sum = 25 as sum of (1, 3, 7, 9,5)

89 correct solutions
81 incorrect solutions

Last solution submitted on Sep 05, 2014

1 player likes this solution

1 Comment

Jean-Marie SAINTHILLIER
on 9 Feb 2014

First time I see this notation.

1 Comment