MATLAB Answers

join words for a title in plot

1 view (last 30 days)
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 Comment

Mohammad Sami
Mohammad Sami on 30 Jan 2020
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');

Sign in to comment.

Accepted Answer

Mohammad Sami
Mohammad Sami on 30 Jan 2020
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 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags

Products


Release

R2019b