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: mean value in a specific region of a 4-d matrix
Replies: 2   Last Post: Oct 1, 2013 10:34 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Derek Goring

Posts: 3,892
Registered: 12/7/04
Re: mean value in a specific region of a 4-d matrix
Posted: Oct 1, 2013 10:34 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Wednesday, October 2, 2013 3:11:06 PM UTC+13, Kuo-Hsien wrote:
> Anyone knows how to do this?
>
> I'd like to know how to get a spatial average in a specific region in each timestep.


First of all, you can do this:
A=squeeze(npp_data_pft1);
because a scalar within an array is meaningless.
Now,
B=A(:,33:47,112:176);
B=reshape(B,100,[]); % Make it a matrix
Bbar=mean(B,2); % Take mean in 2nd dimension



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.