How to avoid unwanted line break in figure title?

54 次查看(过去 30 天)
H all,
I am plotting data for diffenet parameter, where the different parameter are given as string arrays.
nameSources = ["source1", "source2"];
valParameter = ["value1", "value2"];
Each time I write the title, an unwanted line break is introduced.
figure(1)
t = [nameSources(1) ' ' valParameter(1) '%'];
title(t)
Can anybody help?

采纳的回答

Walter Roberson
Walter Roberson 2021-1-25
t = [nameSources{1} ' ' valParameter{1} '%'];
or
t = nameSources(1) + ' ' + valParameter(1) + '%';
  5 个评论
Atikul Haque
Atikul Haque 2023-7-4
编辑:Atikul Haque 2023-7-4
Thank you @Walter Roberson, it has worked for me lastly. But didn't need those extra quote marks outside the 3rd bracket.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Title 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by