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

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 function out = explode(divider,input)
Daniel@0 2 %out = explode(divider,input)
Daniel@0 3 out = {};
Daniel@0 4 len = length(input);
Daniel@0 5 start = 1;
Daniel@0 6 stop = 1;
Daniel@0 7
Daniel@0 8 segment = 1;
Daniel@0 9 while (stop <= len)
Daniel@0 10 while (stop <= len)&& (~strcmp(input(stop),divider))
Daniel@0 11 stop = stop+1;
Daniel@0 12 end
Daniel@0 13 out{segment} = input(start:stop-1);
Daniel@0 14 segment = segment+1;
Daniel@0 15 stop= stop+1;
Daniel@0 16 start = stop;
Daniel@0 17 end
Daniel@0 18
Daniel@0 19
Daniel@0 20