Additional Information

Instead of using the nanm function, create a geographic cells reference object using the georefcells function and a matrix of NaN values using the NaN function. This example shows how to update your code.

Will be removedRecommended
[Z,refvec] = nanm(latlim,lonlim,scale); R = georefcells(latlim,lonlim,1/scale,1/scale);
Z = NaN(R.RasterSize);