function sysc = d2c(sys,method,varargin)
%D2C  Conversion of discrete LTI models to continuous time.
%
%   SYSC = D2C(SYSD,METHOD)  produces an equivalent continuous-time
%   model SYSC for the discrete-time LTI model SYSD.  The string 
%   METHOD selects the conversion method among the following:
%      'zoh'       Assumes zero-order hold on the inputs.
%      'tustin'    Bilinear (Tustin) approximation.
%      'prewarp'   Tustin approximation with frequency prewarping.  
%                  The critical frequency Wc is specified last as in
%                  D2C(SysD,'prewarp',Wc)
%      'matched'   Matched pole-zero method (for SISO systems only).
%   The default is 'zoh' when METHOD is omitted.
%
%   See also  C2D, D2D.

%   Clay M. Thompson  7-19-90
%   Revised: P. Gahinet  8-27-96
%   Copyright (c) 1986-97 by The MathWorks, Inc.
%   $Revision: 1.4 $  $Date: 1997/04/18 14:10:19 $

ni = nargin;
no = nargout;
error(nargchk(1,3,ni))
if ni==1,  
   method = 'zoh';  
elseif ~isstr(method) | ~any(method(1)=='zfmpt'),
   error('Unknown METHOD.')
end

% Call @tf/d2c or @ss/d2c 
if any(method(1)=='mpt'),
   sysc = tf(d2c(zpk(sys),method,varargin{:}));
else
   sysc = tf(ssbal(d2c(ss(sys),method,varargin{:})));
end


% end @tf/d2c


