shows
title({'You can do it','with a cell array'})
works. Now supppose I have two string variables title1 and title2. How can one apply this method? I tried
title({[title1] [title2]})
But this does not seem to work.

 채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2020년 11월 30일

0 개 추천

This works:
title1 = string('The first title-row');
title2 = string('Some Rosetta stonery');
title3 = string('Den sista titelraden');
plot(randn(5))
title({title1,title2,title3})
Note the ','-separation. You can also use vertical concatenation - i.e. replace ',' with ';'.
HTH

추가 답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 11월 30일
편집: Ameer Hamza 2020년 11월 30일

0 개 추천

What you have already wrote is the correct syntax
title1 = 'You can do it';
title2 = 'with a cell array';
title({[title1] [title2]})
You can also write it like this
title({title1 title2})

댓글 수: 2

alpedhuez
alpedhuez 2020년 11월 30일
char, string, cell,...
alpedhuez
alpedhuez 2020년 11월 30일
편집: alpedhuez 2020년 11월 30일
Yes thank you. Just to acknowledge the first answer.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Signal Radiation, Collection, and Reflection에 대해 자세히 알아보기

태그

질문:

2020년 11월 30일

편집:

2020년 11월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by