MATLAB: Surfacem – how to show partial cells

Mapping Toolboxpcolormsurfacem

Hi,
If I do
A = rand(3,3);
lat = [46 46.1 46.2; 42 42.1 42.2; 38 38.1 38.2];
lon = [10 11 12; 10.2 11.2 12.2; 10.4 11.4 12.4];
clf; axesm('MapProjection','eqdconicstd','MapLatLimit',[37.9 46.3]);
surfacem(lat,lon,A);
I will get 4 cells. But if I change the MapLatLimits to [37.9 46.1]:
clf; axesm('MapProjection','eqdconicstd','MapLatLimit',[37.9 46.1]);
surfacem(lat,lon,A);
The top right cell is missing because it is not fully within the lat/lon limits. How can I show cells/values that are only partially within the lat/lon limits in a map plot using surfacem/pcolorm etc?
Thanks, Fredrik, using R2015b

Best Answer

The solution I went with was to find the corners of each grid cell and then do a fillm for each gridpoint separately in a nested loop. It took 1 hour to run the loops but the result is exactly what I was looking for.