I have two matrices:
a = [ 1 10 20; 2 11 22; 3 12 34; 4 13 12];
b = [ 3 12 1; 4 13 25; 5 14 60; 6 15 9 ];
I want to merge them into a single matrix where the rows with the maximum in column 3 used where columns 1 and 2 are identical, i.e. the resulting matrix should look like this:
c = [ 1 10 20; 2 11 22; 3 12 34; 4 13 25; 5 14 60; 6 15 9];
Any suggestions how to do this easily in MATLAB would be greatly appreciated. I've banged my head on a wall trying to use intersect
but to no avail.