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

2 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Labels and Annotations in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by