C is a 36x2 matrix and I want to do the following: I want to check the 1st column for equal values. Let's say we find the (5,1), the (18,1) and the (21,1) elements in the column to be equal. Then I would like to sum the corresponding (5,2)+(18,2)+(21,2) elements in the second column and make each sum appear in the corresponding 3rd column, i.e. in the positiions (5,3), (18,3) and (21,3).
The above seems to almost work. I think it is because after it has searched and found an equality, it gives up on a 2nd potential equality and that's my problem!