Search and select points form each quadrant

1 Ansicht (letzte 30 Tage)
giometar
giometar am 18 Mär. 2020
Beantwortet: darova am 18 Mär. 2020
Hello
How to select two or any number of nearest points from each quadrant?
I have point T and I want to select only two nearest points from each quadrant.

Antworten (1)

darova
darova am 18 Mär. 2020
You can use pdist2 for this purpose
D = pdist2([xt yt],[x(:) y(:)]);
ix = D < 1;
plot(x(ix),y(ix),'or')
hold on
plot(x,y,'.b')
hold off

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by