Effacer les filtres
Effacer les filtres

what is the best possible way to find the missing values using interpolation

2 vues (au cours des 30 derniers jours)
Sehoon Chang
Sehoon Chang le 29 Juil 2020
Hi all,
i have an array that is measured in a hour interval.
ex) a_1_hour = [ 1 5 9 13 17 21 ]
but i wish to find out how the values would be if it was a measurement taken in 15-minutes interval.
ex) a_15_min = [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ]
I have presented a linear increase for the sake of easy demonstration. However, the actual values do not increase/decrease linearly.
What is the best possible way to interpolate the unknow 15-minutes interval values?
thanks

Réponses (1)

Stephen23
Stephen23 le 30 Juil 2020
>> a60 = [1,5,9,13,17,21];
>> t60 = 60*(0:numel(a60)-1);
>> t15 = t60(1):15:t60(end);
>> a15 = interp1(t60,a60,t15)
a15 =
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by