How do I get a 25-hour running mean for a time series that does not calculate the NaNs? I have an hourly data.

 採用された回答

Walter Roberson
Walter Roberson 2021 年 3 月 28 日

1 投票

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 件のコメント

Sammy
Sammy 2021 年 3 月 29 日
It works!! Thank you so much! :D
darova
darova 2021 年 3 月 29 日

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCoastal Engineering についてさらに検索

製品

質問済み:

2021 年 3 月 28 日

コメント済み:

2021 年 3 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by