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.