MATLAB: Make a matrix smaller based on some criteria

kalim

I am working with a matrix.
A=[...
20 40 21.5 41
5 21 15 10]
Now, first of all, I want to find out the similar values from row 1. Lets say, the similar values are 20 and 21.5, another pair is 40 and 41. For the each pair, I want to eliminate one column from each pair based on their corresponding column value in the second row. So, I want to eliminate
41
10
and
20
5
because its value in the second row is smaller. The final matrix that I want is
21.5 40
15 21
Thanks in Advance.

Best Answer

row 1 is 20 40 21.5 41 and second row is 5 21 15 10