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

1 回表示 (過去 30 日間)
Sehoon Chang
Sehoon Chang 2020 年 7 月 29 日
回答済み: Stephen23 2020 年 7 月 30 日
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

回答 (1 件)

Stephen23
Stephen23 2020 年 7 月 30 日
>> 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

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by