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