function [stat,post] = blkpoly(path,prop,bstr,bint,bflt,parent,name,catalog,ws,node)
%BLKPOLY Defines a polynomial in one variable or a set of polynomials each
%        described by one variable.
%
% See also

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

   stat = 0;			   		   % Error flag
   nInputs = bint(5);
   nOutputs = bint(6);
   %
   % Add mux and demux blocks if necessary
   %
   [post,rect] = blkio('port',nInputs,nOutputs,prop,path);
   %
   % Get the polynomial coefficients
   %
   indInt = bint(15)+1;
   symInd = 0;
   str = cell(size(symInd));
   mode = bint(indInt);
   if (bitand(mode,16))
      symInd(1) = 1;
      indStr = bint(17)+1;
      ind = mfindstr(bstr,indStr,'|');
      str{1} = bstr(indStr:ind-1);
   end
   %
   % Get the block parameter variables
   %
   [symInd,str] = mgetscope(symInd,str,catalog,ws,node);
   if (symInd == 0)
      indFlt = bint(16);
      indInt = bint(18)+1;
      indInt = bint(indInt)+indInt;		   % Skip icon data
      lenPoly = bint(indInt)+1;
      coeffs = zeros(nOutputs,lenPoly);		   % Polynomial coefficients
      cRange = 1:lenPoly*nOutputs;
      coeffs(:) = bflt(indFlt+cRange);
      str{1} = mat2char(coeffs);
   end
   %
   % Polynomial in one variable block.
   %
   bh = add_block('libsb2sl/ALG/1VarPoly',path,...
		  'ForegroundColor',prop.fgColor,...
		  'BackgroundColor',prop.bgColor,...
		  'Orientation',prop.orientation,...
		  'DropShadow',prop.border,...
		  'Position',rect,...
		  'COEFF',str{1});
   %
   % Connect the current polynomial block with the mux and demux blocks
   %
   blkio('line',nInputs,nOutputs,post,parent,name);
   return					   % Last card of BLKPOLY
