MATLAB: Break title into multiple lines? Part 2

MATLAB

shows
title({'You can do it','with a cell array'})
works. Now supppose I have two string variables title1 and title2. How can one apply this method? I tried
title({[title1] [title2]})
But this does not seem to work.

Best Answer

This works:
title1 = string('The first title-row');
title2 = string('Some Rosetta stonery');
title3 = string('Den sista titelraden');
plot(randn(5))
title({title1,title2,title3})
Note the ','-separation. You can also use vertical concatenation - i.e. replace ',' with ';'.
HTH