Title spacing problems with cell array
1 回表示 (過去 30 日間)
古いコメントを表示
Hello dear community,
How can i make the Title line into two lines? I wish to have the outcome in this way:
Condition: AA
Pressure: 10 %

With the following code i couldn't achieve what i wish to achieve, i am looking forward to any Tips and Help. Thanks.
condition_array = {'AA', 'BB', 'CC'};
pressure_array = {'10','20','30'};
for aa = 1:3
for bb = 1:3
title(['Condition: ' ,condition_array(aa),'Pressure: ',pressure_array(bb)])
end
end
0 件のコメント
回答 (2 件)
Cris LaPierre
2021 年 7 月 9 日
編集済み: Cris LaPierre
2021 年 7 月 9 日
You will find the Create Title and Subtitle example helpful. A slightly different approach is shown below.
condition_array = 'AA';
pressure_array = '10';
title(["Condition: " + condition_array; "Pressure: " + pressure_array + " %"])
0 件のコメント
Simon Chan
2021 年 7 月 9 日
for aa = 1:3
for bb = 1:3
title(sprintf('Condition: %s \n Pressure: %s %%',condition_array{aa}, pressure_array{bb}))
end
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Title についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!