Using the function movmean
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, so i have a data set of average wave heights taken every 10 minutes for the last 60 years. I want to use the function 'movmean' to give an 8 week moving average of wave heights. Any idea how I might go about this?
0 Kommentare
Antworten (1)
Image Analyst
am 23 Apr. 2017
10 minutes for 8 weeks is 8064 elements I believe. So just do
averageWaveHeights = movmean(waveHeights, 8064);
That's pretty obvious, so I'm wondering what the real problem is. Like your elements are actually not every 10 minutes or something. Even if they weren't exactly 10 minute, it wouldn't matter much as long as the total window width covers 8 weeks. Did you try movmean() at all yet? What was the problem you had with it?
3 Kommentare
nlm
am 7 Mai 2020
How to calculate a 10 day average when the timeseries has duplicate dates. I do not want to average the dupliate dates priorly. I want to include them in the 10 day average. When I use movmean, I get this error, any suggestions ?
Error using builtin
'SamplePoints' value contains duplicates.
Error in datetime/movmean (line 105)
y = builtin('_movmeandt', args{:});
Image Analyst
am 7 Mai 2020
Use unique() to remove duplicates. Start a new question and attach your data if you still have problems.
Siehe auch
Kategorien
Mehr zu Logical 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!