Path: news.mathworks.com!not-for-mail
From: "Li " <liqingjiang@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to average column values to the same minute?
Date: Wed, 2 Jun 2010 21:19:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 19
Message-ID: <hu6hsb$fpu$1@fred.mathworks.com>
References: <hu6ca4$6p$1@fred.mathworks.com> <f97cec95-f9ec-41a2-840b-76de084de454@y18g2000prn.googlegroups.com> <83ae6706-488d-4f66-ba0a-56dff8392379@11g2000prv.googlegroups.com> <hu6gh4$e3t$1@fred.mathworks.com>
Reply-To: "Li " <liqingjiang@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1275513547 16190 172.30.248.37 (2 Jun 2010 21:19:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 2 Jun 2010 21:19:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2042635
Xref: news.mathworks.com comp.soft-sys.matlab:641623

I found the solution: B = grpstats(A, A(:,1:5));

Thanks. 



"Li " <liqingjiang@gmail.com> wrote in message <hu6gh4$e3t$1@fred.mathworks.com>...
> Thanks, but I am afraid that it does not solve my problem. I have millions of data from 1900 all the way to 2010. The number of measurements within a minute ranging from 1 to 20. I do not think it is simply a reshape and average. What I want are the averages within each minute, instead of the average of the whole time span. 
> 
> 
> TideMan <mulgor@gmail.com> wrote in message <83ae6706-488d-4f66-ba0a-56dff8392379@11g2000prv.googlegroups.com>...
> > Oh, I see.........
> > I misread the headers.
> > 
> > A1=reshape(A(:,6),12,[]);  % Form a 12xn matrix
> > Abar=mean(A1).';   % Take the mean of each column and transpose
> > 
> > Note: the no of rows in the matrix A must be a multiple of 12 or you
> > must reduce it to that.