Moving averages / Moving median etc

버전 1.1.0.0 (1.66 KB) 작성자: Aslak Grinsted
Calculates moving averages (or median/fun) of a timeseries.
다운로드 수: 15.9K
업데이트 날짜: 2011/6/16

라이선스 보기

MOVING will compute moving averages of order n (best taken as odd)

Usage: y=moving(x,n[,fun])
where x is the input vector (or matrix) to be smoothed.
m is number of points to average over (best odd, but even works)
y is output vector of same length as x
fun (optional) is a custom function rather than moving averages

Note:if x is a matrix then the smoothing will be done 'vertically'.


Example:

x=randn(300,1);
plot(x,'g.');
hold on;
plot(moving(x,7),'k');
plot(moving(x,7,'median'),'r');
plot(moving(x,7,@(x)max(x)),'b');
legend('x','7pt moving mean','7pt moving median','7pt moving max','location','best')

인용 양식

Aslak Grinsted (2024). Moving averages / Moving median etc (https://www.mathworks.com/matlabcentral/fileexchange/8251-moving-averages-moving-median-etc), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R14
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Smoothing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

added Screenshot, updated description

1.0.0.0

Made more flexible and more robust.