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

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]);

 Accepted Answer

%if true
plot(rand(10));
title('[head neck helmet impact energy rep]');

More Answers (2)

Define the titles with an extra space at the end of each word.
Try this:
title(sprintf('%s %s %s %s %s %s', head, neck, helmet, impact, energy, rep);

Categories

Tags

Community Treasure Hunt

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

Start Hunting!