-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tsEvaRunningMeanTrend: series filling logics moved to tsEvaFillSeries
- Loading branch information
Lorenzo Mentaschi
authored and
Lorenzo Mentaschi
committed
Jun 16, 2016
1 parent
3e7a704
commit 6282602
Showing
2 changed files
with
15 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function [ filledTimeStamps, filledSeries, dt ] = tsEvaFillSeries( timeStamps, series ) | ||
indxs = ~isnan(series); | ||
timeStamps = timeStamps(indxs); | ||
series = series(indxs); | ||
|
||
mint = min(timeStamps); | ||
maxt = max(timeStamps); | ||
dt = min(diff(timeStamps)); | ||
filledTimeStamps = (mint:dt:maxt)'; | ||
filledSeries = interp1(timeStamps, series, filledTimeStamps, 'nearest'); | ||
filledSeries = tsRemoveConstantSubseries(filledSeries, 4); | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters