movmean 'SamplePoints'

18 Ansichten (letzte 30 Tage)
Shlomit Sharoni
Shlomit Sharoni am 1 Mai 2019
Kommentiert: Rik am 1 Mai 2019
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 Kommentar
Rik
Rik am 1 Mai 2019
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Graphics Objects finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by