Use strjoin to merge the strings and a loop to go over the rows:
C = {'aaa', 'b', 'cccc';
'string1', 'string2', 'string3'}
newcol = size(C, 2) + 1;
for row = 1 : size(C, 1)
C{newcol, 4} = strjoin(C(row, :), '_');
end
Or using cellfun instead of a loop:
newC = cellfun(@(row) [row, strjoin(row, '_')], num2cell(C, 2), 'UniformOutput', false)
newC = vertcat(newC{:})
Best Answer