I would like to add a customized title to my plot:
name='function';
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y)
title(['Plot of','name'],...
'FontSize',13,'FontWeight','normal');
but it doesn't work. How can I solve this?

댓글 수: 1

You have put '' around name. That makes it a static char
name='function';
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y)
title(['Plot of ',name],...
'FontSize',13,'FontWeight','normal');

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

 채택된 답변

Mohammad Sami
Mohammad Sami 2020년 1월 30일

0 개 추천

You have put '' around name. That makes it a static char
name='function';
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y)
title(['Plot of ',name],...
'FontSize',13,'FontWeight','normal');

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Labels and Styling에 대해 자세히 알아보기

제품

릴리스

R2019b

태그

질문:

2020년 1월 30일

답변:

2020년 1월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by