| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
ts = setinterpmethod(ts,Method)
ts = setinterpmethod(ts,FHandle)
ts = setinterpmethod(ts,InterpObj),
ts = setinterpmethod(ts,Method) sets the default interpolation method for timeseries object ts, where Method is a string. Method in ts. Method is either 'linear' or 'zoh' (zero-order hold). For example:
ts = timeseries(rand(100,1),1:100); ts = setinterpmethod(ts,'zoh');
ts = setinterpmethod(ts,FHandle) sets the default interpolation method for timeseries object ts, where FHandle is a function handle to the interpolation method defined by the function handle FHandle. For example:
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);
Note For FHandle, you must use three input arguments. The order of input arguments must be new_Time, Time, and Data. The single output argument must be the interpolated data only. |
ts = setinterpmethod(ts,InterpObj), where InterpObj is a tsdata.interpolation object that directly replaces the interpolation object stored in ts. For example:
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);
This method is case sensitive.
getinterpmethod, timeseries, tsprops
![]() | setfield | setpixelposition | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |