How to input a text variable in a plot title?

조회 수: 11 (최근 30일)
Ilias Tripodis
Ilias Tripodis 2018년 7월 13일
편집: Ilias Tripodis 2018년 7월 13일
Hello, I have 100 plots to do but I have to change the title and the labels every time. Is it possible to input a value with the name of the title and the labels in order to be set in all plots without doing it by my own? Thank you in advance for your response!

채택된 답변

Fangjun Jiang
Fangjun Jiang 2018년 7월 13일
Is this what you want?
title('plot title')
TitleText='second plot';
title(TitleText)
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2018년 7월 13일
use sprintf(), use %d for numerical data, use %s for string
title(sprintf('%s vs Time',x))
Ilias Tripodis
Ilias Tripodis 2018년 7월 13일
편집: Ilias Tripodis 2018년 7월 13일
It definitely works! Thank you very much!

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

추가 답변 (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