help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vectorized moving average?


From: Francesco Potortì
Subject: Re: vectorized moving average?
Date: Thu, 06 May 2010 11:40:39 +0200

>Does anyone know how to take an n-day weighted moving average of a vector
>without using a for-loop?

Use the filter function.

> I looked at the M code for movavg() and it uses a
>for-loop, so I'm guessing there probably isn't a way, but I thought I'd
>check.  Thanks.

I don't know why it does so, but it looks very inefficient, at least for
long vectors.

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]