How can I use different methods for interpolation and extrapolation in "retime" or "synchronize" functions in MATLAB R2022a?
Show older comments
I would like to use different methods for interpolation and extrapolation in "retime" or "synchronize", e.g. use linear interpolation and use nearest neighbor extrapolation at the same time. Currently, the extrapolation in these functions can only be done using the same method as specified for interpolation, or using a specified constant extrapolation value by means of the `EndValues` argument.
For example:
x = (1:10)+rand(1,10)-0.5;
tt = timetable(years(1:10)',x'); % Dummy timetable example
retimett = retime(tt,years(1:0.5:12),'linear'); % Linearly interpolates and extrapolates. Cannot use separate methods for each.
Accepted Answer
More Answers (0)
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!