function setInterpMethod(ts,method)
%SETINTERPOLATION  Set interpolation method for time series object
%
%   setInterpMethod(TS,'MethodName') sets the interpolation method in the 
%   time series object TS to that given by the string 'MethodName'. 
%   Predefined interpolation methods are 'zoh' (zero order hold) and 
%   'linear'(linear interpolation). Users can also define their own 
%   interpolation methods. 
%
%   Note that this method is case sensitive.
%
%   Example:
% 
%   Create a time series object:
%   ts=tsdata.timeseries(rand(5))
%
%   Get the interpolation method for this object:
%   getInterpMethod(ts)
%
%   Change the interpolation method to 'linear':
%   setInterpMethod(ts,'linear')
%
%   See also TSDATA.TIMESERIES/GETINTERPMETHOD,
%   TSDATA.TIMESERIES/TIMESERIES

%   Author(s): Rong Chen
%   Copyright 1986-2003 The MathWorks, Inc. 
%   $Revision: 1.1.6.1 $  $Date: 2004/12/26 21:35:18 $

if ischar(method)
    set(ts.datainfo.interpolation,'fhandle',{@tsinterp method},'Name',method);
    %ts.datainfo.interpolation=tsdata.interpolation(method);
else
    error('a string is required as the name of the interpolation method.');
end
