| Contents | Index |
Set default interpolation method for timeseries object
ts = setinterpmethod(ts, method)
ts = setinterpmethod(ts, fhandle)
ts = setinterpmethod(ts, interpobj)
ts = setinterpmethod(ts, method) sets the default interpolation method, method, for timeseries object, ts, and outputs it to ts1.
ts = setinterpmethod(ts, fhandle) sets the default interpolation method for timeseries object ts, where fhandle is a function handle to the interpolation method.
ts = setinterpmethod(ts, interpobj) sets the default interpolation method for timeseries object ts, where interpobj is a tsdata.interpolation object that directly replaces the interpolation object stored in ts.
This method is case sensitive.
ts1 |
The timeseries object that results when you set the interpolation method for the original timeseries object. |
Set the default interpolation method for timeseries object ts to zero order hold:
ts = timeseries(rand(100,1),1:100); ts = setinterpmethod(ts,'zoh'); plot(ts);
Set the default interpolation method for timeseries object ts, where fhandle is a function handle to the interpolation method defined by function handle myFuncHandle:
ts = timeseries(rand(100,1),1:100);
myFuncHandle = @(new_time, time, data)...
interp1(time, data, new_time,...
'linear','extrap');
ts = setinterpmethod(ts, myFuncHandle);
ts = resample(ts, [-5:0.1:10]);
plot(ts);
Set the default interpolation method for timeseries object ts to a tsdata.interpolation object:
ts = timeseries(rand(100,1),1:100);
myFuncHandle = @(new_time, time, data)...
interp1(time, data, new_time,...
'linear','extrap');
myInterpObj = tsdata.interpolation(myFuncHandle);
ts = setinterpmethod(ts,myInterpObj);
plot(ts);

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 |