function [knots,coefs,n,k,d]=spbrk(spline,print)
% SPBRK	Take apart a spline in B-form.
%
%     [knots,coefs,n,k,d] = spbrk(spline[,print])
%
%  breaks apart a spline and, optionally, prints its parts.

% C. de Boor / latest change: Feb.25, 1989
% Copyright (c) 1990-92 by Carl de Boor and The MathWorks, Inc.


if (spline(1)~=11),
   error('the input array does not seem to describe a spline')
else,
   d=spline(2);n=spline(3);
   coefs=zeros(d,n);coefs(:)=spline(3+[1:d*n]);
   k=spline(4+d*n);knots=spline(4+d*n+[1:k+n]);
   if (nargin>1), knots,coefs,n,k,d,end
end
