Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to calculate weighted mean in Matlab
Replies: 3   Last Post: Feb 18, 2013 2:16 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jan-Erik

Posts: 5
Registered: 6/28/11
Re: How to calculate weighted mean in Matlab
Posted: Feb 18, 2013 1:51 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

hesam eivazy <hesamaldien@gmail.com> wrote in message <25a0e76d-84b5-4aba-a3da-803630b7a046@googlegroups.com>...
> A=180-by-360 matrix of (surface temperature)
> B=180-by-360 matrix of latitudes corresponding to A
> weighted mean=(sum(A.*B))/(180*360)
>


Thanks for your answer! However, I don't get the answer that I need.

I usually use FERRET when I work with global gridded fields. Calculating the global weighted average with FERRET is different. FERRET computes an approximation to the global mean using the gridded field. Given a latitude and longitude vector it defines a grid and already knows how to weight each value depending on the latitude.

In Matlab the data fields are loaded as a matrix. Taken the mean of this matrix 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.

Is there a function or method that accounts for that in Matlab when working with global gridded fields?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.