Mercurial > hg > mauch-mirex-2010
annotate _FullBNT/KPMtools/num2strcell.m @ 9:4ea6619cb3f5 tip
removed log files
author | matthiasm |
---|---|
date | Fri, 11 Apr 2014 15:55:11 +0100 |
parents | b5b38998ef3b |
children |
rev | line source |
---|---|
matthiasm@8 | 1 function c = num2strcell(n, format) |
matthiasm@8 | 2 % num2strcell Convert vector of numbers to cell array of strings |
matthiasm@8 | 3 % function c = num2strcell(n, format) |
matthiasm@8 | 4 % |
matthiasm@8 | 5 % If format is omitted, we use |
matthiasm@8 | 6 % c{i} = sprintf('%d', n(i)) |
matthiasm@8 | 7 |
matthiasm@8 | 8 if nargin < 2, format = '%d'; end |
matthiasm@8 | 9 |
matthiasm@8 | 10 N = length(n); |
matthiasm@8 | 11 c = cell(1,N); |
matthiasm@8 | 12 for i=1:N |
matthiasm@8 | 13 c{i} = sprintf(format, n(i)); |
matthiasm@8 | 14 end |
matthiasm@8 | 15 |
matthiasm@8 | 16 |