How to filter out x-y coordinates and data from a plot, covering exactly the boundary of some region?

2 次查看(过去 30 天)
I want to extract the data that belongs exactly to within a particular boundary, but I don't know how to go about it.
  1 个评论
KSSV
KSSV 2017-7-11
If your small region data falls beyond the main region data, then you can do extrapolation but this is not suggested. Why don't you show your domains pictorially so that we can get clear idea.

请先登录,再进行评论。

采纳的回答

Chad Greene
Chad Greene 2017-7-16
To find points in a polygon use inpolygon, just as I suggested in the other post. If you're using Mouginot's annual velocity dataset, the coordinates are
x = -2800000:1000:2800000;
y = (2800000:-1000:-2800000)';
and when you plot it you can use
imagesc(x,y,V)
axis xy image
To find the pixels corresponding to Amery, get a grid of x,y points like this:
[X,Y] = mesghrid(x,y);
Then use inpolygon following the example I wrote for Wilkins Ice Shelf here.
Since you're using the Measures annual data, are you aware of the measuresann_interp function?

更多回答(1 个)

KSSV
KSSV 2017-7-11
You can get the points lying inside the closed region using inpolygon. Read about inpolygon.
  6 个评论
Aditya Wahi
Aditya Wahi 2017-7-12
Sir, I tried using the code that you gave me, but rgb2gray command is giving me the following error:-
Error using rgb2gray>parse_inputs (line 82)
MAP must be a m x 3 array.
Error in rgb2gray (line 37)
X = parse_inputs(X);
What can I do about this?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Color and Styling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by