I performed several tests to measure how y depends on x. I repeated the value of x in some of the tests. If x was repeated, the higher values of y are more reliable. Given a vector of x and y, I would like to find (a) the max value of y obtained for each value of x, i.e. selecting the max of the repeated tests plus any y value for which the value of x wasn't retested, and (b) all values of y from the repeated tests that were not the max value. I believe this can be done with a clever application of histc. Here is an example,
x = [ 219 292 292 365 365 365 402 438 438 511 ] ;
y = [ 69.9 76.4 72.6 61.6 48.9 77.7 77.6 76 78.9 73.3 ] ;
iMax = ?? ;
plot(x(iMax), y(iMax), 'b') ; hold on ;
iNotMax = ??
plot(x(iNotMax), y(iNotMax), 'b*') ;