How to Add same Index Array Elements in Octave
Posted on 2014-04-07
I've generated elements w(i,j) of an array, most of which are zeros. Some of the elements have the same index j and I'd like to add them up and show each j with its corresponding summed up value. I tried v = sum(w) and it did show the summed up values but as elements of a large matrix, with most elements being zero. Is there a different way to accomplish that task?