How to separate plot titles on single line? [solved]

9 Ansichten (letzte 30 Tage)
Ludovico Riello
Ludovico Riello am 4 Jul. 2021
Bearbeitet: Ludovico Riello am 6 Jul. 2021
figure()
plot (time,BrACOM)
%xlim ([tmin tmax])
xlabel('Time [s]');
ylabel('Acc [g]');
legend('x','y','z');
title([head neck helmet impact energy rep]);
I would like the variables to be spaced on the plot title, like:head neck helmet impact energy rep and not headneckhelmetimpactenergyrep
Solution:
title([head ' ' neck ' ' helmet ' ' impact ' ' energy]);

Akzeptierte Antwort

VBBV
VBBV am 4 Jul. 2021
%if true
plot(rand(10));
title('[head neck helmet impact energy rep]');

Weitere Antworten (2)

Alan Stevens
Alan Stevens am 4 Jul. 2021
Define the titles with an extra space at the end of each word.

Les Beckham
Les Beckham am 4 Jul. 2021
Try this:
title(sprintf('%s %s %s %s %s %s', head, neck, helmet, impact, energy, rep);

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by