MATLAB: How can to add a line break in Latex

latexline breakMATLAB

LS,
I would like to make a line break within an Latex equation. The command
\newline
in the next code is not working:
text('Position',PosOne, 'interpreter','latex', 'string','$$\ a= \newline \frac{b}{c} $$');
Can anyone tell me what I'm doing wrong? Your help is appreciated a lot.
Best regards,
Frits

Best Answer

text(0.5, 0.5, ...
'string', {'$$a=$$', '$$\ \frac{b}{c}$$'}, ...
'interpreter', 'latex');
or:
text(0.5, 0.5, ...
'string', ['$$a=$$', char(10), '$$\ \frac{b}{c}$$'], ...
'interpreter', 'latex');
Related Question