Hi

I need to calculate the sum of cross diagonals of a non symmetric matrix.

if A=[ 1 2 3 4;5 6 7 8; 9 8 7 3]

I want to calculate the sum of all the diagonals from left to right and store it in an array such as:

B=[1 7 18 19 15 3]

Can someone help me to find the logic for this calculation?

Similar questions and discussions