| Contents | Index |
Select or interpolate timeseries data using new time vector
ts1 = resample(ts, time)
ts1 = resample(ts, time, interp_method)
ts1 = resample(ts, time, interp_method, code)
ts1 = resample(ts, time) resamples the timeseries object, ts, using the new time vector. The resample method uses the default interpolation method, which you can view by using the getinterpmethod(ts) syntax.
ts1 = resample(ts, time, interp_method) resamples the timeseries object ts using the specified interpolation method, interp_method.
ts1 = resample(ts, time, interp_method, code) resamples the timeseries object ts using the interpolation method given by the string interp_method. MATLAB applies the code to all samples.
ts1 |
The timeseries object that results when you interpolate the original timeseries object with a new time vector. |
Resample a timeseries object:
% Create a timeseries object: ts1 = timeseries([1.1; 2.9; 3.7; 4.0; 3.0],1:5,'Name','speed'); % View the time, data. amd interpolation method: ts1.time ts1.data ts1.getinterpmethod % Resample ts1 using its default interpolation method: res_ts=resample(ts1,[1 1.5 3.5 4.5 4.9]); % View the time, data, and interpolation method for the resampled object: res_ts.time res_ts.data res_ts.getinterpmethod
getinterpmethod | setinterpmethod | synchronize | timeseries

Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |