Starting from R2016b this could be solved rather easily: join(text,','). However, "join" was implemented differently before 2016b and it will give a result like this: 'a,X,1,b,Y,2,c,z,3' (not a row by row concatenation as the customer desires)
The simplest solution before 2016b will just be using a for loop to concatenate the cell array row by row as vectorization is not possible.
result = cell(size(text,1), 1);
for i = 1: size(text, 1)
result(i, :) = {strjoin(text(i, :), ',')};
end
Best Answer