please interpret this result from the filter function
Ältere Kommentare anzeigen
Please help me interpret this result from matlab. The input uses a filter function.
data = [1:0.2:4]';
windowSize = 5;
filter(ones(1,windowSize)/windowSize,1,data)
ans =
0.2000
0.4400
0.7200
1.0400
1.4000
1.6000
1.8000
2.0000
2.2000
2.4000
2.6000
2.8000
3.0000
3.2000
3.4000
3.6000
So the data spans from 1 to 4 with increments of 0.2. Windowsize of 5, I assume, is the length of the moving average filter used. This means it will take an average of 5 consecutive inputs (1 to 1.8, 1.2 to 2.0, and so on).
I don't understand the filter function itself. Is this a moving average filter? Why is the output such? Thanks
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!