Additional Information

Instead of using the spzerom 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] = spzerom(latlim,lonlim,scale); R = georefcells(latlim,lonlim,1/scale,1/scale);
Z = sparse(R.RasterSize(1),R.RasterSize(2));