Filter - smooth (calculating the moving average along a vector)

버전 1.2 (1.52 KB) 작성자: Adrian Lara-Quintanilla
This function calculates the moving average along that vector. It can be used to smooth a series.
다운로드 수: 2.1K
업데이트 날짜: 2014/11/19

라이선스 보기

function [vectorout]=moving_average(vectorin,eFave)
Author: Adrián Lara-Quintanilla
Date: 12/03/2013

This function calculates a moving average along a vector. "eFave" is the
number of elements around the element in the input vector "vectorin" used
to calculate the averaged value in "vectorout". The values at the
beginning and at the end of "vectorin" that could not be calculated with
and average of "eFave" elements are calculated as an average of the
remaining values at the beginning or at the end of "vectorin".
Note: "eFave" should be an odd number. If not, '1' is added to its value.

Example: vectorin=[1 2 5 4 8 9] and eFave=4.
eFave->5, vector out=[x1 x2 4 5.6 x5 x6], note that x3 and x4 can be
calculated as a mean of the 5 elements (including themselves) around
them. Because this can not be applied on x1,x2,x5,x6, and the goal is to
smooth the series, x1=1, x2=mean(1 and 2), x3=mean(8 and 9)
and x4=9

인용 양식

Adrian Lara-Quintanilla (2024). Filter - smooth (calculating the moving average along a vector) (https://www.mathworks.com/matlabcentral/fileexchange/40758-filter-smooth-calculating-the-moving-average-along-a-vector), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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

toolbox

1.1.0.0

rewrite title and description

1.0.0.0