Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
difference between filter and movavg output

Subject: difference between filter and movavg output

From: david

Date: 10 Mar, 2011 15:38:07

Message: 1 of 2


I am currently using the filter function to calculate an exponential moving average with the following code:


Which seems to work fine, however, when I use a for loop to calculate the same EMA I am getting different results. The for loop is as follows:

for i=2:length(data);

Using the "movavg" function gives the same results as above.
Has anyone any idea as to why these 2 methods are providing different results?
If so, could you please point out where my errors are?

Subject: difference between filter and movavg output

From: Charbel

Date: 20 Apr, 2011 12:15:08

Message: 2 of 2

Sorry can't help U...

i only have one question:

N is the number of points that u got?

Best Regards


Tags for this Thread

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.

Contact us