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

1 view (last 30 days)
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

Answers (1)

Stephen23
Stephen23 on 30 Jul 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

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!