How to analyse this data set?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello experts,
I have some data points and can easily plot them on a figure in MATLAB. For some reason, I need to find out what data points are located inside some rectangle areas as can be seen in attached picture. In this picture, black dots represent my data points and red rectangles represent mentioned areas. In this example, how can I search into my data points and see whether they belong to any rectangle or not? I need to have a list of all members (data points) for each rectangle. I hope I explained my problem clearly. Any idea and advice is appreciated.
0 comentarios
Respuesta aceptada
KSSV
el 4 de Mayo de 2017
Editada: KSSV
el 4 de Mayo de 2017
doc inpolygon
N = 30 ;
[X,Y] = meshgrid(1:N,1:N) ;
plot(X,Y,'.k','markersize',10) ;
%%polygon coordinates
Rect = [ 8.5369 23.4840
17.4539 23.4840
17.5230 16.7493
7.6382 16.4869
8.5369 23.4840] ;
hold on
plot(Rect(:,1),Rect(:,2),'r');
%%get points inside the polygon
idx = inpolygon(X,Y,Rect(:,1),Rect(:,2)) ;
%%points inside polygon
xi = X(idx) ; yi = Y(idx) ;
plot(xi,yi,'ob')
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Database Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!