I have used MATLAB to generate the 720 x 360 x 187 NetCDF data which means to be the global data. Currently, I hope to clip it with the polygon. I reviewed the MATLAB answers but I still cannot find any solution.
I tried to use "inpolygon", but it did not work. It kept telling me "matrix dimensions must agree". I used transpose and they don't work.
I tried to use Interp2 and interp3 (since it is a 3-dimensional data) but neither works.
Please let me know what I should do so that I can clip my NetCDF data with my polygon. Thank you.