Thread Subject: averaging data series

Subject: averaging data series

From: Ben

Date: 23 Jun, 2008 18:33:02

Message: 1 of 6

I have a quick question.

I have data listed in 10 minute intervals and I was
wondering how to average it, so that the data is now in 30
minute intervals. The data is already in a .mat file. I
need to transform it into a different average. There is
about 10 years worth of data so I can't do it individually
or using vector indexing.

Thanks.

Subject: averaging data series

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 23 Jun, 2008 18:35:54

Message: 2 of 6

In article <g3oq8u$c88$1@fred.mathworks.com>, Ben <bburrou2@uiuc.edu> wrote:

>I have data listed in 10 minute intervals and I was
>wondering how to average it, so that the data is now in 30
>minute intervals.

decimate() would sound appropriate.
--
  "Beauty, like all other qualities presented to human experience,
  is relative; and the definition of it becomes unmeaning and
  useless in proportion to its abstractness." -- Walter Pater

Subject: averaging data series

From: AMK

Date: 22 Jul, 2008 21:51:58

Message: 3 of 6

This looks like a convenient function, but I am unable to make it work.

>> y = decimate(data(:,1),2)
??? Undefined function or method 'decimate' for input arguments of type 'double'.

Where data(:,1) = dt = datenum(y1(:,3), y1(:,4), y1(:,5), y1(:,6), y1(:,7), 0) are 1 hour data.

Does this run from the base matlab command prompt?

Subject: averaging data series

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 22 Jul, 2008 23:04:25

Message: 4 of 6

In article <26631652.1216763549409.JavaMail.jakarta@nitrogen.mathforum.org>,
AMK <kennaster@gmail.com> wrote:
>This looks like a convenient function, but I am unable to make it work.

>>> y = decimate(data(:,1),2)
>??? Undefined function or method 'decimate' for input arguments of type 'double'.

Sorry, it appears to be part of the signal processing toolbox.
--
  "You can't hit what you can't see." -- Walter "The Big Train" Johnson

Subject: averaging data series

From: Roger Stafford

Date: 23 Jul, 2008 00:32:02

Message: 5 of 6

"Ben " <bburrou2@uiuc.edu> wrote in message <g3oq8u$c88
$1@fred.mathworks.com>...
> I have a quick question.
>
> I have data listed in 10 minute intervals and I was
> wondering how to average it, so that the data is now in 30
> minute intervals. The data is already in a .mat file. I
> need to transform it into a different average. There is
> about 10 years worth of data so I can't do it individually
> or using vector indexing.
>
> Thanks.

  If the number of successive 10-minute entries is a multiple of three, you can
do the following. Let x be a column vector of the data.

 x2 = mean(reshape(x,[],3),2);

Now x2 is a column vector of one third as many 30-minute averages.

Roger Stafford

Subject: averaging data series

From: AMK

Date: 23 Jul, 2008 01:31:25

Message: 6 of 6

My data aren't in that format. In fact, I have 1 minute and fifteen minute data that need to be aggregated into 30 minute averages. It seems like this might be better accomplished outside of Matlab and then brought in?

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com