Using the function movmean

7 visualizaciones (últimos 30 días)
Joseff Saunders
Joseff Saunders el 23 de Abr. de 2017
Comentada: Image Analyst el 7 de Mayo de 2020
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?

Respuestas (1)

Image Analyst
Image Analyst el 23 de Abr. de 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 comentarios
nlm
nlm el 7 de Mayo de 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
Image Analyst el 7 de Mayo de 2020
Use unique() to remove duplicates. Start a new question and attach your data if you still have problems.

Iniciar sesión para comentar.

Categorías

Más información sobre Data Types en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by