strcat

strcat(str1,str2,...) concatenates horizontally strings, string arrays or cell array of strings str1, str2, ....

Examples

>> strcat('a','b','c')# 

% strings

abc >> ['a','b','c']#

% horizontal concatenation using brackets

abc
>> t = table({'a'; 'b'; 'c'}, {'d'; 'e';'f'})# 

 Col1 Col2 
    a    d 
    b    e 
    c    f 

>> t.Col3 = strcat(t.Col1,t.Col2) 

% create a column concatenating string arrays

t# Col1 Col2 Col3 a d ad b e be c f cf
>> strcat('a',{'b','c'})# 

% string with cell array of strings

[ab][ac]
>> strcat({'a','c'},{' - '},{'b','d'})# 

% cells array of strings

[a - b][c - d]

Resources

See also

cat