Daniel@0: function c = num2strcell(n, format) Daniel@0: % num2strcell Convert vector of numbers to cell array of strings Daniel@0: % function c = num2strcell(n, format) Daniel@0: % Daniel@0: % If format is omitted, we use Daniel@0: % c{i} = sprintf('%d', n(i)) Daniel@0: Daniel@0: if nargin < 2, format = '%d'; end Daniel@0: Daniel@0: N = length(n); Daniel@0: c = cell(1,N); Daniel@0: for i=1:N Daniel@0: c{i} = sprintf(format, n(i)); Daniel@0: end Daniel@0: Daniel@0: