movmean 'SamplePoints'

조회 수: 18 (최근 30일)
Shlomit Sharoni
Shlomit Sharoni 2019년 5월 1일
댓글: Rik 2019년 5월 1일
I am trying to cunduct a moving average with variable sample points, which depands on the time vector, in this example, every 2 time units
x = [1 2 3 4 2 5 3 ]
time = [ 1 1 2 2 3 4 7]
yd = movmean(x,2,'SamplePoints',time);
and I get the followinf error:
'Error using movmean
'SamplePoints' value contains duplicates.'
How can I fix it? and I also want to find the standard deviation in the same way...
Furthermore 'movmean' apply only from MATLAB 2017, is there a way to do it in earlier versions?
  댓글 수: 1
Rik
Rik 2019년 5월 1일
You may have to write it yourself if you want to support duplicate timepoints. The clearly states that the SamplePoints must be unique and sorted.
Also, movmean was introduced in R2016a, not 2017.

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by