In MATLAB, ...
is used to continue a line to the next line. But if I want to continue a long string within quotation, what can I do? ...
will be tr
answer=['You can divide strings '...
,'by adding a comma '...
,'(as you probably know one year later).'];
If you put the string in brackets, you can build it in several pieces:
s = ['abc' 'def' ...
'ghi'];
You can then split that statement into several lines between the strings.
You can use strcat or horzcat, which gives you somewhat more options than [], including the ability to mix in variables along with the hardcoded values.