getinterpmethod
Interpolation method of a timeseries.
Category: Language Fundamentals > Data Types
Syntax
m = getinterpmethod(ts)
Returns the name of the interpolation method.
Description
The method decides how values between samples are computed when the series is resampled or sampled at new times. 'linear' draws straight lines; 'zoh' holds each value until the next sample. Change it with setinterpmethod.
Input arguments
tstimeseriesobject.
Output arguments
m- Character vector:
'linear'(default) or'zoh'(zero-order hold).
Example
Default and changed
ts = timeseries([1; 2; 3], [0; 1; 2]);
getinterpmethod(ts)
ts = setinterpmethod(ts, 'zoh');
getinterpmethod(ts)
Output
ans = 'linear'
ans = 'zoh'