Azzera filtri
Azzera filtri

25-hourly mean

1 visualizzazione (ultimi 30 giorni)
Sammy
Sammy il 28 Mar 2021
Commentato: darova il 29 Mar 2021
How do I get a 25-hour running mean for a time series that does not calculate the NaNs? I have an hourly data.

Risposta accettata

Walter Roberson
Walter Roberson il 28 Mar 2021
movmean(YourData, 25, 'omitnan')
This assumes that YourData has something for every hour (even if NaN.)
If you have less regular data, including the case where your data skips the entries for missing data or where the data is not consistently 1 hour apart, then instead
movmean(YourData, hours(25), 'SamplePoints', Timestamps_for_existing_data)
  2 Commenti
Sammy
Sammy il 29 Mar 2021
It works!! Thank you so much! :D
darova
darova il 29 Mar 2021

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Oceanography and Hydrology in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by