Your input data is something like that:
A =[1 4.5];
B = [2.5 5.3];
C = [3.5 5.1];
D = [6.2 6.1];
E = [6.8 6.1];
F = [7.2 6];
G = [9.5 4.8];
H = [11.2 5.5];
I = [13 5];
ALL= [A;B;C;D;E;F;G;H;I];
plot(ALL(:,1),ALL(:,2))
[X,Y] = meshgrid(1:12,1:7);
hold on
plot(X,Y,'.k')
If your black points (A,B,C,...) do not overlay the grid but can lay in between blue points, like this:
first you need to evaluate the red point I dotted in red in the image above with a linear interpolation:
xq = [1 2 3 4 5 6 7 8 9 10 11 12];
vq = interpn(ALL(:,1)',ALL(:,2)',xq,'linear');
and then you can do a comparison like that:
for jj=1:size(Y,2)
YY(:,jj)=Y(:,jj)<=vq(jj)
end
plot(X(YY),Y(YY),'or')