Mercurial > hg > camir-ismir2012
annotate core/tools/implode.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 = implode(divider, input); |
Daniel@0 | 2 % out = implode(divider, input) |
Daniel@0 | 3 |
Daniel@0 | 4 out = []; |
Daniel@0 | 5 for i = 1:numel(input) |
Daniel@0 | 6 |
Daniel@0 | 7 % only put divider inbetween data |
Daniel@0 | 8 if i > 1 |
Daniel@0 | 9 |
Daniel@0 | 10 out = sprintf('%s%s%d', out, divider, input(i)); |
Daniel@0 | 11 else |
Daniel@0 | 12 |
Daniel@0 | 13 out = sprintf('%d', input(i)); |
Daniel@0 | 14 end |
Daniel@0 | 15 end |