function cc=pdebsplit(c)
%PDEBSPLIT Splits space separated string into separate rows.
%
%	CC=PDEBSPLIT(C) splits the string C into its space separated
%	components. A maximum of four space separated string components
%	is allowed. The separated string components are returned as
%	rows in a string matrix.

%	Magnus Ringh 9-12-95.
%	Copyright (c) 1994-95 by The MathWorks, Inc.
%	$Revision: 1.1.1.1 $  $Date: 1995/09/13 08:07:24 $

if ~isstr(c),
  error('Entry must be a string.')
end
if size(c,1)~=1,
  error('String contains more tha one line.')
end
c=[fliplr(deblank(fliplr(deblank(c)))), ' '];
whites=find(isspace(c));
c(whites(find(diff(whites)==1)+1))=[];
whites=find(isspace(c));
nc=length(whites);
if nc>4,
  error('A maximum of four strings is allowed.')
end
if nc==1,
  cc=c(1:whites-1);
else
  cc=c(1:whites(1)-1);
  for k=1:nc-1,
    cc=str2mat(cc,c(whites(k)+1:whites(k+1)-1));
  end
end
