e
% <cdtarea_documentation.html |cdtarea|> to get the area of each grid cell. 
% Here are the areas of each grid cell: 

% turn lat,lon arrays into grids:
[Lon,Lat] = meshgrid(lon,lat); 

% Get the area of each grid cell: 
A = cdtarea(Lat,Lon,'km2'); 

imagescn(lon,lat,A)
hold on
borders % national borders
    
cb = colorbar; 
ylabel(cb,'grid cell area (km^2)')

%% 
% With the grid cell areas |A|, we can now get the area-averaged sea surface
% temperature with |wmean|: 

wmean(sst,A,'all','omitnan')

%% 
% 