annotate toolboxes/bioakustik_tools/strings/explode.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function out = explode(divider,input)
wolffd@0 2 %out = explode(divider,input)
wolffd@0 3 out = {};
wolffd@0 4 len = length(input);
wolffd@0 5 start = 1;
wolffd@0 6 stop = 1;
wolffd@0 7
wolffd@0 8 segment = 1;
wolffd@0 9 while (stop <= len)
wolffd@0 10 while (stop <= len)&& (~strcmp(input(stop),divider))
wolffd@0 11 stop = stop+1;
wolffd@0 12 end
wolffd@0 13 out{segment} = input(start:stop-1);
wolffd@0 14 segment = segment+1;
wolffd@0 15 stop= stop+1;
wolffd@0 16 start = stop;
wolffd@0 17 end
wolffd@0 18
wolffd@0 19
wolffd@0 20