Sorry if this is a very simple question, but how would I go about finding the sum of a set of predetermined elements in a matrix. So if I was using
a=magic(50),
I found that my idea of using the command
x = sum(a, (1, [5 7 19 33 34 35 36 47 50]))
does not provide the output (the sum of the elements in those positions) that I wanted. I would appreciate any help.
Best Answer