필터 지우기
필터 지우기

Moving Mean Function - How to apply

조회 수: 2 (최근 30일)
Dario Walter
Dario Walter 2019년 6월 1일
댓글: Dario Walter 2019년 6월 1일
Hey guys,
I want to create a moving average with window size 4 as depicted below (take last 4 entries and in the beginning the highest number of entries available).
Unfortunately I do not get along with the "movmean" function. Can anyone help me?
Val MovAvg
1 1
2 1,5
3 2
4 2,5
5 3,5
6 4,5
7 5,5
8 6,5

채택된 답변

Guillaume
Guillaume 2019년 6월 1일
movmean(yourvector, [3, 0], 'Endpoints', 'shrink'); %3 values backward (plus current value), 0 forward. Shrink at edges (beginning only since only looking backward)
  댓글 수: 1
Dario Walter
Dario Walter 2019년 6월 1일
Perfect! Thank you so much Guillaume!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by