How to get red of the detected data points in the matrix [x y] (The points with in the range 0.5) and make the next code returns a new matrix [X Y] withOUT the detected ones with in the range 0.5 .
x = gallery('uniformdata',30,1,1);y = gallery('uniformdata',30,1,10);plot(x,y,'.')k = boundary(x,y);hold on;plot(x(k),y(k));%%get points at distance 0.5 from boundary
idx = rangesearch([x y],[x(k) y(k)],0.5);% plot the points
N = length(k) ;for i = 1:Nplot(x(idx{i}),y(idx{i}),'O','color',rand(1,3)) ;end
Thank you
Best Answer