function [stat,post] = blkdeadband(path,prop,bstr,bint,bflt,parent,name,catalog,ws,node)
%BLKDEADBAND Performs a threshold function.
%
% See also BLKDEADBAND, BLKSATURATION, BLKBNDLIMIT, BLKPRELOAD.

% Initial coding by A S Bozin, 6-10-97
% Copyright 1997-2000 The MathWorks, Inc.
% $Revision: 1.5 $ $Date: 2000/06/14 16:09:00 $

   stat = 0;			   		   % Error flag
   nInputs = bint(5);
   nOutputs = bint(6);
   %
   % Build mux and demux if necessary
   %
   [post,rect] = blkio('port',nOutputs,nOutputs,prop,path);
   %
   % Get the deadzone parameter
   %
   indStr = bint(17)+1;
   indInt = bint(15)+1;
   npar = 1;
   symInd = zeros(1,npar);
   mode = bint(indInt);
   if (bitand(mode,16))
      indInt = indInt+2;
      iRange = 1:bint(indInt);
      symInd(bint(indInt+iRange)) = 1;
   end
   str = cell(npar,1);
   for (k = find(symInd))
      ind = mfindstr(bstr,indStr,'|');
      str{k} = bstr(indStr:ind-1);
      indStr = ind+1;
   end
   %
   % Get the block parameter variables
   %
   [symInd,str] = mgetscope(symInd,str,catalog,ws,node);
   indFlt = bint(19);
   pLen = zeros(npar,1)+nInputs;
   ub = cumsum(pLen);
   lb = [0;ub(1:end-1)]+1;
   for (k = find(~symInd))
      params = zeros(1,pLen(k));
      bRange = lb(k):ub(k);
      params(:) = bflt(indFlt+bRange);
      str{k} = mat2char(params);
   end
   %
   % Dead band block
   %
   bh = add_block('built-in/DeadZone',path,...
		  'ForegroundColor',prop.fgColor,...
		  'BackgroundColor',prop.bgColor,...
		  'Orientation',prop.orientation,...
		  'DropShadow',prop.border,...
		  'Position',rect,...
		  'LowerValue',cat(2,'-0.5*',str{1}),...
		  'UpperValue',cat(2,' 0.5*',str{1}));
   %
   % Connect the current block with the mux and demux blocks (if any)
   %
   blkio('line',nOutputs,nOutputs,post,parent,name);
   return					   % Last card of BLKDEADBAND
