MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

As an alternative, you can use the strcat function. strcat appends text whether the
input arguments are strings or character vectors.


str = strcat("Hello","World")


str = "HelloWorld"


Whether you use square brackets, plus, or strcat, you can specify an arbitrary number
of arguments. Append a space character between Hello and World.


str = "Hello" + " " + "World"


str = "Hello World"


See Also


cd | contains | copyfile | dir | isempty | length | load | plus | size | sprintf |
strcat | string | strlength


Related Examples



  • “Create String Arrays” on page 6-12

  • “Test for Empty Strings and Missing Values” on page 6-31

  • “Compare Text” on page 6-47

  • “Update Your Code to Accept Strings” on page 6-72


See Also
Free download pdf