Search All of the Math Forum:

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

Topic: matrix mean
Replies: 9   Last Post: Sep 11, 2013 5:13 PM

 Messages: [ Previous | Next ]
 Curious Posts: 2,357 Registered: 12/6/04
Re: matrix mean
Posted: Sep 9, 2013 2:01 PM

"someone" wrote in message <l0kkvm\$o3m\$1@newscl01ah.mathworks.com>...
> "Puneet" wrote in message <l0kc2v\$l2a\$1@newscl01ah.mathworks.com>...
> > Hi - this is begginers question.
> > I have a data set - 16 rows and 16 columns - I would like to average every 2 points to get an 8 rows 8 columns matrix.
> >
> > This is a learning phase so I can run something similar later for larger data sets.
> > Thanks.

>
> %Perhaps something like:
>
> a = rand(16,16);
> b = a(1:2:15, 1:2:15); % odd rows & columns
> c = mean(b(:));
>
> % may not be most efficient,
> % but you should get the idea
>
> % I'll leave the even rows & columns to you
> % (you didn't specify which you wanted).

But even so,
going from a 16X16 to a 8X8 matrix
would average every fourth point.
(Or something like that.)
So, I guess I don't understand the OP.

Date Subject Author
9/9/13 Puneet
9/9/13 Curious
9/9/13 Curious
9/9/13 dpb
9/10/13 Puneet
9/10/13 Curious
9/10/13 dpb
9/10/13 dpb
9/10/13 Steven Lord
9/11/13 arich82