Effacer les filtres
Effacer les filtres

creating multi-line title with variable values

4 vues (au cours des 30 derniers jours)
sermet
sermet le 8 Août 2016
Modifié(e) : Stephen23 le 8 Août 2016
doy=100; %double
igs=abcd; %string
title({'ERROR (m)';'doy:';'igs:'})
How can I write "doy" variable (100) and "igs" variable (abcd) right near the 'doy:' and 'igs:' on the title?

Réponse acceptée

Stephen23
Stephen23 le 8 Août 2016
Modifié(e) : Stephen23 le 8 Août 2016
You can also make a multiline title by constructing a string with newline charcters. This is trivial to construct using sprintf and the arguments:
txt = sprintf('ERROR (m)\ndoy: %d\nigs: %s',doy,igs)
title(txt)
Or, if you really wish to use a cell array:
C = {'ERROR (m)',sprintf('doy: %d',doy),['igs: ',igs]};
title(C)

Plus de réponses (0)

Catégories

En savoir plus sur Scatter Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by