join words for a title in plot

3 Ansichten (letzte 30 Tage)
Gaetano Pavone
Gaetano Pavone am 30 Jan. 2020
Beantwortet: Mohammad Sami am 30 Jan. 2020
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 Kommentar
Mohammad Sami
Mohammad Sami am 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');

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Mohammad Sami
Mohammad Sami am 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');

Weitere Antworten (0)

Kategorien

Mehr zu Labels and Styling finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by