MATLAB: How to find min and max of a matrix

min/max

Hi,
Suppose I have a matrix with two columns:
A= [1.6700 0.5300; 1.6800 0.5400; 1.6900 0.5200; 1.6500 0.5100; 1.7000 0.5500];
And I'm looking for the row which simulaneously gives me the smallest value of the first column and the largest value of the second column, how would I go about doing that?
I'm not looking for the min of the first column and the max of the second column separately. I'm looking for the "best combination", i.e. the single row which gives me the smallest possible value of the first column and the largest possible column of the second column.
Any ideas?

Best Answer

Use sortrows. Specify that you want to sort the first column in ascending order and the second in descending order.