lass="codeinput"><span class="comment">% turn lat,lon arrays into grids:</span>
[Lon,Lat] = meshgrid(lon,lat);

<span class="comment">% Get the area of each grid cell:</span>
A = cdtarea(Lat,Lon,<span class="string">'km2'</span>);

imagescn(lon,lat,A)
hold <span class="string">on</span>
borders <span class="comment">% national borders</span>

cb = colorbar;
ylabel(cb,<span class="string">'grid cell area (km^2)'</span>)
</pre><img vspace="5" hspace="5" src="wmean_documentation_02.png" alt=""> <p>With the gri