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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by