Effacer les filtres
Effacer les filtres

Suptitle - is it possible to use with arguments besides text?

2 vues (au cours des 30 derniers jours)
shir shalom
shir shalom le 1 Sep 2016
Commenté : michio le 1 Sep 2016
for example - I want my super title to display the value of my variable "num".
I coded this:
suptitle('my number=%u',num)
and got the error message:
Error using suptitle Too many input arguments.
Can I make it somehow?
Thanks, Shir

Réponse acceptée

michio
michio le 1 Sep 2016
suptitle accepts one input argument, so try
suptitle(['my number= ',num2str(num)])
  2 commentaires
shir shalom
shir shalom le 1 Sep 2016
Modifié(e) : shir shalom le 1 Sep 2016
great, thanks! also found out it works with sprintf:
suptitle(sprintf('my number=%u',num))
michio
michio le 1 Sep 2016
Great:) sprintf gives more flexibility.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Labels and Annotations 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