The matrix A is given by several repeated values of A(:,1) positions with different A(:,2) values like:
clc;clear allA=[1 101 91 81 71 62 152 142 132 122 113 183 173 163 153 144 124 114 104 94 8];scatter(A(:,1),A(:,2),'filled','r')
Represented by the following red dots:
The matrix B, represents 1 [X,Y] combination for each B(:,1) as:
%%
B=[1 82 143 114 12]; hold onscatter(B(:,1),B(:,2),'filled','b')
How can I eliminate all the values extrictly higher than any B(:,2) for each B(:,1) and keep only same or lower values getting a C matrix like:
%%C=[1 81 71 62 142 132 122 114 124 114 104 94 8];scatter(C(:,1),C(:,2),'filled','g')
green dots represent the wanted points to keep.
Best Answer