Hey everybody,
I'm processing some data and i'm stuck at the moment. I have a matrix consisting of 2 columns and about 4000 rows. A simplified example is given below:
data = 0 1.5 0.2 0.3 0.4 4 0.6 0.2 0.8 0.9 1 1.5 0 2 0.2 1.2 0.4 0.8 0.6 2.3 0.8 4.5 1 1.3
And what I need is that when values in column 1 are the same, then values of the second column are added to get one answer for one value in column 1. For the data above this would give:
For 0: 1.5 + 2 = 3.5
0.2: 0.3 + 1.2 = 1.5
0.4: 4 + 0.8 = 4.8
etc.
Could anyone help me with how to do this? Cause at the moment, I really don't know how. I tried a if loop but it didn't work.
Best Answer