recipes : Text Processing : Concatenating strings

Problem

You want to concatenate (join) two strings.

Solution

In Matlab all things can be joined using the concatenation operator: [ ].

A='The quick ';
B='brown fox';
[A,B]
ans =

The quick brown fox

Discussion

Note the space after the "k" in variable A. If A did not have this space we would have had to do: [A,' ',B].