Path: news.mathworks.com!not-for-mail
From: "ade77 " <ade100a@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: applying functions to grouped data
Date: Thu, 5 Nov 2009 03:48:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <hcthti$43u$1@fred.mathworks.com>
References: <hcsqn1$ju4$1@fred.mathworks.com> <hct2gg$mm8$1@fred.mathworks.com> <hctf96$l7g$1@fred.mathworks.com>
Reply-To: "ade77 " <ade100a@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257392882 4222 172.30.248.38 (5 Nov 2009 03:48:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 5 Nov 2009 03:48:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1059495
Xref: news.mathworks.com comp.soft-sys.matlab:582607



> thanks for your response!  actually, i'm having a problem even getting the dates in correctly to matlab.  i'm importing a large file that has dates in the first column, and matlab will always separate it from the rest of the columns.  how would i reincorporate this first column and apply the moving average filter?  also, what if i wanted to apply some other moving function, other than averages?
> 
> thanks so much!

First save your orignal file before manipulating it. then create another copy.

Is your file an excel file? One easy way is to create ( in excel) three additional columns for year, month and day. I am not sure how good your excel is. 

The problem with excel is that when the date is in 'date format' in excel, MATLAB has problem recognizing that format.

So once you import it into MATLAB, let me know. Actually, the actual code of your moving average is very easy to write.

If you do not know how to create those columns in excel , let me know and I will give you the steps. Like new_col 1= YEAR(A1), new_col2 = MONTH(A1) etc