%% Concatenate Two String Arrays
% Starting in R2017a, you can create string arrays using double quotes. Concatenate them with the strcat function. Note that when concatenated in this way the output string will insert a whitespace character between the input strings.

str1 = ["John ","Mary "];
str2 = ["Smith","Jones"];
str = strcat(str1,str2)

%
% Strings and character vectors can be combined using strcat. When concatenating strings with character vectors a whitespace will not be added. Concatenate a character vector onto each element of the string array.

str3 = strcat(str,', M.D.')

% To combine strings and character vectors, consider using + instead.

str4 = str + ', M.D.'

% Copyright 2012 The MathWorks, Inc.