MATLAB: Clip Geotiff image by many polygons

clipgeotiffpolygonsshape file

Hello everyone, I have a geotiff image and a shape file which contains 13 polygons and I need to clip this image based on these polygons and sum the pixels for each polygon
how can I clip it by many polygons?
thank you

Best Answer

Have a look on inpolygon. This function can give you indices lying inside the closed polygon.