필터 지우기
필터 지우기

How to avoid unwanted line break in figure title?

조회 수: 35 (최근 30일)
Martin Laurenzis
Martin Laurenzis 2021년 1월 25일
편집: Atikul Haque 2023년 7월 4일
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에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by