linear fit for dates that do not have data
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
alpedhuez
am 25 Nov. 2020
Kommentiert: alpedhuez
am 25 Nov. 2020
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 Kommentare
Walter Roberson
am 25 Nov. 2020
Filling ending up with a duplicate value is not filling with linear trend.
Akzeptierte Antwort
Ameer Hamza
am 25 Nov. 2020
Bearbeitet: Ameer Hamza
am 25 Nov. 2020
See fillmissing(): https://www.mathworks.com/help/matlab/ref/fillmissing.html. You can use the linear method to fill the values.
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!