The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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,922
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:
because a scalar within an array is meaningless.
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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.