How to interpolate under specific condition?
Mostrar comentarios más antiguos
Hi everyone. I would appreciate your help on this.
I have a daily timeseries of temperature observations for 2006-2016.
I want to reconstruct missing values (see attached) with an interpolation method only if the missing values cover less that 3 days. If the gap is larger (>4days), I want NaN values to be preserved. Column A contains the dates I have temperature observations (NaT indicates temperature is NaN) and Column C is the full time sequence 2006-2016.
How can I do this? I am totally confused... The interpolation method could be anything, I have not decided on this yet.
Thank you in advance!
PS. I am on R2019a.
Respuesta aceptada
Más respuestas (1)
Steven Lord
el 14 de En. de 2021
1 voto
If you were using release R2020b or later, I would recommend calling the fillmissing function with the 'MaxGap' option. I'm leaving this as an answer even though you're using release R2019a for future reference by other users or in case you can and are willing to upgrade.
1 comentario
Daphne PARLIARI
el 14 de En. de 2021
Categorías
Más información sobre Calendar en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!