Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: average every 12th row of matrix
Date: Thu, 5 Nov 2009 17:30:35 +0000 (UTC)
Organization: PatientsLikeMe
Lines: 7
Message-ID: <hcv23r$ft4$1@fred.mathworks.com>
References: <hcv1e7$3ua$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257442235 16292 172.30.248.35 (5 Nov 2009 17:30:35 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 5 Nov 2009 17:30:35 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1841757
Xref: news.mathworks.com comp.soft-sys.matlab:582807


"Nix Nicholson" <linznix@gmail.com> wrote in message <hcv1e7$3ua$1@fred.mathworks.com>...
> Hi: Beginner question - I have 7 years of some monthly data fields and I want to compute the average for each month over the 7 year period. I can do it by specifying row numbers but how could I do this so that come next year, when i have 8 years data I can just change a scaler value for year number and it will recompute a new average?
> basically how do i compute a mean of every nth row, in my case every 12th.
> 
> Many thanks

You should be able to user the FILTER command to do this.