I have a cell array where the first column is a county name, the second column is a county name, and the third column is the demand (class doubles) between the first and second column. You could essentially think of column 1 and column 2 as a pair.
In this array, there are duplicates of some of the county pairs and I want to find all those duplicates. After finding the dulpicates for a particular county pair, I want to add all the demand values from those duplicates to the original one. After adding them, I want to delete the rows with the duplicates. I want to do this for any of the duplicate pairs that might appear within the array. (*Note*: this needs to do it for a variety of duplicate pairs -> so there may be 3 duplicates between Suffolk and Erie county, but there may also be 10 duplicates between Albany and Kent county.)
I was thinking I could for loops and go through this, but the index will change if I delete rows, so I'm not quite sure how to actually go about doing this.
Thank you in advance!