How to remove points lying outside interpolated spatial map

3 次查看(过去 30 天)
Hi all,
The image shows some precipitation distribution file after interpolation. But some of the points are going outside the map. I need to remove those points or fix it as Nan. But I have no idea how to identify specific lat-lon which are outside the CONUS map and fix it as Nan. so that pcolorm don't colour that part. The simple code, which I used is below here:
[LatGrid, LonGrid] = meshgrid(linspace(min(CONUS_LAT), max(CONUS_LAT)), ... linspace(min(CONUS_LON), max(CONUS_LON)));
CONUS_grid = griddata(CONUS_LAT, CONUS_LON, X_precip, LatGrid, LonGrid);
pcolorm(LatGrid, LonGrid, CONUS_grid);
I hope the code is okay but please let me know how to remove the points that are lying outside the map through code. Thanks in advance.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simscape Electrical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by