Title spacing problems with cell array
조회 수: 3 (최근 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 %
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/679223/image.jpeg)
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!