I am using several num2str in one annotation in the statement shown below. It works produces an output that is vertical and broken up in several lines, one for each variable. Please help!

6 views (last 30 days)
annotation(figure1,'textbox',... [0.183098591549296 0.861108922363847 0.244131455399061 0.06720741599073],... 'String',{'\alpha=' num2str(alpha) '\alpha_1=' num2str(alpha1) '\Phi_1=' num2str((phase),2)},... 'FontWeight','bold',... 'FontSize',18,... 'FontName','Times New Roman',... 'LineStyle','none');

Answers (1)

Titus Edelhofer
Titus Edelhofer on 23 Dec 2014
Hi,
you used {} to concatenate. In this case you create a cell array, and this tells annotation to break into several lines.
Concatenate to one string using [] instead:
'String', ['\alpha=' num2str(alpha) ', \alpha_1=' num2str(alpha1) ', \Phi_1=' num2str((phase),2)] ...
Titus

Categories

Find more on Characters and Strings in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!