Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
shir shalom
shir shalom am 1 Sep. 2016
Kommentiert: michio am 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

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Labels and Annotations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by