%% Combine Elements of String Array with Delimiters
% Combine elements in a string array. Instead of spaces, insert different pieces of text between the strings in str.
% Create a string array. Starting in R2017a, you can create strings using double quotes.

str = ["x","y","z";
       "a","b","c"]

%
% Concatenate the strings with dashes between them.

newStr = join(str,"-")

%
% Concatenate the strings with symbols that make the output strings represent equations. The delimiters argument must be a 2-by-2 array because str is a 2-by-3 array.

delimiters = [" + "," = ";
              " - "," = "];
newStr = join(str,delimiters)

% Copyright 2012 The MathWorks, Inc.