Link to home
Start Free TrialLog in
Avatar of judico
judico

asked on

How to Add same Index Array Elements in Octave

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?
ASKER CERTIFIED SOLUTION
Avatar of judico
judico

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of judico
judico

ASKER

This is the best solution I could come up with so far. There are memory problems for large arrays. I may address these problems later.