function [stat,post] = blkbreakpts(path,prop,bstr,bint,bflt,parent,name,catalog,ws,node)
%BLKBREAKPTS This block defines general piece-wise linear representations of nonlienar functions.
%
% See also BLKC1INTERP, BLKS1INTERP, BLKL2INTERP, BLKS2INTERP.

% Initial coding by A S Bozin, 18-05-98
% Copyright 1997-2000 The MathWorks, Inc.
% $Revision: 1.4 $ $Date: 2000/06/14 16:08:40 $

   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 breakpoint matrix
   %
   indFlt = bint(16);
   indStr = bint(17)+1;
   indInt = bint(18)+1;
   indInt = bint(indInt)+indInt;		   % Skip icon data
   nRows = bint(indInt);
   indInt = bint(15)+1;
   npar = 1;					   % Number of parameters
   symInd = zeros(1,npar);
   if (bitand(bint(indInt),16))
      indVar = indInt+2;
      vRange = 1:bint(indVar);
      symInd(bint(indVar+vRange)) = 1;
   end
   str = cell(npar,1);
   if (symInd)
      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)
      rDim = nRows;
      cDim = 2*nOutputs;
      ub = rDim*cDim;
      lb = 1;
      points = zeros(rDim,cDim);
      bRange = lb:ub;
      points(:) = bflt(indFlt+bRange);
      points(:,[1:2:end 2:2:end]) = points;
      str{1} = mat2char(points);
   end
   %
   % General break-points block.
   %
   bh = add_block('libsb2sl/ARC/BreakPoints',path,...
		  'ForegroundColor',prop.fgColor,...
		  'BackgroundColor',prop.bgColor,...
		  'Orientation',prop.orientation,...
		  'DropShadow',prop.border,...
		  'Position',rect,...
		  'BrkPoints',str{1});
   %
   % Connect the current linear interpolation block with the mux and demux blocks
   %
   blkio('line',nInputs,nOutputs,post,parent,name);
   return					   % Last card of BLKBREAKPTS
