




0001 function [split,cnt]=explode(string,lim) 0002 0003 if isempty(string) 0004 split{1}=''; 0005 cnt=0; 0006 0007 else 0008 r=string; 0009 i=0; 0010 0011 while ~isempty(r) 0012 [piece,r]=strtok(remainder,lim); 0013 i=i+1; 0014 split{i}=piece; 0015 end 0016 cnt=i; 0017 0018 end