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 20:56:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <hu6gh4$e3t$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>
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 1275512164 14461 172.30.248.37 (2 Jun 2010 20:56:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 2 Jun 2010 20:56:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2042635
Xref: news.mathworks.com comp.soft-sys.matlab:641613

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.