Effacer les filtres
Effacer les filtres

How to interpolate missing value using n values before and after the missing data?

4 vues (au cours des 30 derniers jours)
Prashanti Ganesh
Prashanti Ganesh le 11 Jan 2022
Commenté : Stephen23 le 12 Jan 2022
Hello All,
I am trying to linearly interpolate a missing value by using values that were measured before and after the missing data. However, I don't want to use the first value measured before and after the missing data. Rather I would like use n values before and after the missing data for linear interpolation. How can I do that?
Here is an example of my problem:
I want to interpolate for value between x(5) and x(7). But I want to use n = 3 values before and after x(6) for linear interpolation. I.e. I want to use x(3), x(4), x(5) and x(7), x(8), x(9) values for interpolation.
x = [1 2 3 4 5 7 8 9 10];
Thanks,
Prashanti
  8 commentaires
John D'Errico
John D'Errico le 12 Jan 2022
Modifié(e) : John D'Errico le 12 Jan 2022
@Jan Kudlacek - you CANNOT accept a comment as an answer. You never posted an answer, just a comment. If you think your comment deserves an acceptance, then you need to post it as an answer. We cannot even upvote comments.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by