MATLAB Answers

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

1 ビュー (過去 30 日間)
Ludovico Riello
Ludovico Riello 2021 年 7 月 4 日
編集済み: Ludovico Riello 2021 年 7 月 6 日
plot (time,BrACOM)
%xlim ([tmin tmax])
xlabel('Time [s]');
ylabel('Acc [g]');
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
title([head ' ' neck ' ' helmet ' ' impact ' ' energy]);


VBBV 2021 年 7 月 4 日
%if true
title('[head neck helmet impact energy rep]');

その他の回答 (2 件)

Alan Stevens
Alan Stevens 2021 年 7 月 4 日
Define the titles with an extra space at the end of each word.

Les Beckham
Les Beckham 2021 年 7 月 4 日
Try this:
title(sprintf('%s %s %s %s %s %s', head, neck, helmet, impact, energy, rep);


Community Treasure Hunt

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

Start Hunting!

Translated by