linear fit for dates that do not have data

1 回表示 (過去 30 日間)
alpedhuez
alpedhuez 2020 年 11 月 25 日
コメント済み: alpedhuez 2020 年 11 月 25 日
Suppose I have table such as
Date Visitors
-------------------------------------
"January 1" 10
"January 2"
"January 3" 15
"January 4"
"January 5"
"January 6"
"January 7" 18
"January 8"
I want to fill a linear trend for missing data
Date Visitors
-------------------------------------
"January 1" 10
"January 2" 12.5
"January 3" 15
"January 4" 15.75
"January 5" 16.5
"January 6" 17.25
"January 7" 18
"January 8"
but what I try to do here is to apply different fit function for different intervals: the fit function for January 1 and 3 is different from the one for January 3 to 7.
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 11 月 25 日
Filling ending up with a duplicate value is not filling with linear trend.
alpedhuez
alpedhuez 2020 年 11 月 25 日
編集済み: alpedhuez 2020 年 11 月 25 日
Corrected before I saw your post.

サインインしてコメントする。

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 25 日
編集済み: Ameer Hamza 2020 年 11 月 25 日
See fillmissing(): https://www.mathworks.com/help/matlab/ref/fillmissing.html. You can use the linear method to fill the values.
  1 件のコメント
alpedhuez
alpedhuez 2020 年 11 月 25 日
Thank you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by