I am working with gridded global fields with different resolutions from global climate models. Some gridded fields (such the one from HadGEM2) have different grid sizes depending on the latitude.
In ferret computing the global weighted average is pretty straight forward. Ferret computes an approximation to this value using the gridded field. However, in Matlab the data fields are loaded as a matrix. Taken the mean of this matrix (by using the function "mean2", for example) does not weight the different elements by its area and gives me only the unweighted-average. This gives me an global average that is not really realistic. If, for example, the latitudinal resolution increases near the equator, so that you have more grid points near the equator, the unweighted-average will suddenly be biased towards grid values that are near the equator.
Is there a function or method that accounts for that in Matlab when working with global gridded fields?