MATLAB: How to extract data through the shapefile from global precipitation data.

Hello Guys,
I have shapefile for Sikkim(India) region. Actually, I want to extract Sikkim region data through this shapefile from global data. Please help me for doing this. I am attaching here both (Shapefile and Global data in .hdf).
Thank you so much in advance.
Regards,
Gargi

Best Answer

  1. Load the global data
  2. Load the shape file.
  3. Get the (x,y) coordinates of your required region shape file.
  4. Use inpolygon to get the global data coordinates lying inside the required region cooridnates. This gives the logical indices of the required coordinates.
  5. Using the logical indices, you can extract your required data.
Related Question