Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
shir shalom
shir shalom el 1 de Sept. de 2016
Comentada: michio el 1 de Sept. de 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

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Labels and Annotations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by