time series interpolation of irregular data

1 vue (au cours des 30 derniers jours)
Harish Vernekar
Harish Vernekar le 23 Juin 2021
Commenté : Harish Vernekar le 23 Juin 2021
here goes the data , i need data for vacant years ,
Thank you!
2012 105683
2013 1,108,498
2014 1,177,810
2015 1,271,872
2016 1,351,970
2017 1,433,392
2018 1,486,493
2019 1,546,517
2020 1,598,41
2021
2022
2023
2024
2025
2026
2027
2028 251800

Réponse acceptée

KSSV
KSSV le 23 Juin 2021
data = [ 2012 105683
2013 1108498
2014 1177810
2015 1271872
2016 1351970
2017 1433392
2018 1486493
2019 1546517
2020 159841
2021 NaN
2022 NaN
2023 NaN
2024 NaN
2025 NaN
2026 NaN
2027 NaN
2028 251800 ] ;
x = data(:,1) ;
y = data(:,2) ;
idx = isnan(y) ;
y(idx) = interp1(x(~idx),y(~idx),x(idx)) ;

Plus de réponses (1)

Sargondjani
Sargondjani le 23 Juin 2021
You can use "griddedInterpolant". I would use 'pchip' as method.

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by