function [xi,xd] = mblkpid(ki,kd,tau,x0)
%MBLKPID Driver for the PID controller block.
%
% See also

% Initial coding by A S Bozin, 6-23-98
% Copyright 1997-2000 The MathWorks, Inc.
% $Revision: 1.4 $ $Date: 2000/06/14 16:12:21 $

   if (isempty(x0))
      x0 = zeros(1,2);
   end
   if ((ki == 0) & (kd == 0))
      xi = 0;
      xd = 0;
   elseif (ki == 0)
      xi = 0;
      xd = -tau*x0(1);
   elseif (kd == 0)
      xi = x0(1);
      xd = 0;
   else
      xi = x0(1);
      xd = -tau*x0(2);
   end
   return					   % Last card of MBLKPID
