I am trying to find the sum of certain coordinates in a matrix.
I have a N x M
matrix. I have a vector which contains 2xM
values. Every pair of values in the vector is a coordinate in the matrix. Hence their are M
number of coordinates. I want to find the sum of all of the coordinates without using a for loop.
Is there a matrix operation I can use to get this?
Thanks