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: matrix mean
Replies: 9   Last Post: Sep 11, 2013 5:13 PM

Advanced Search

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

Posts: 2,359
Registered: 12/6/04
Re: matrix mean
Posted: Sep 9, 2013 10:12 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Puneet" wrote in message <l0kc2v$l2a$>...
> 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).

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.