How to add a superscript to a uicontrol?

4 visualizaciones (últimos 30 días)
Armindo
Armindo el 21 de Feb. de 2016
Comentada: Walter Roberson el 22 de Feb. de 2016
Can anyone explain me why this dont work (superscript)?
r10 = uicontrol(bg,'Style','radiobutton',...
'String',sprintf('New %g^{n}',2),...
'Position',[0 0 100 30],...
thanks

Respuesta aceptada

Walter Roberson
Walter Roberson el 21 de Feb. de 2016
sprintf('<HTML>New %g<SUP>n</SUP>',2)
Uicontrol have never supported tex or latex. Some uicontrol support HTML.
  2 comentarios
Stephen23
Stephen23 el 22 de Feb. de 2016
Editada: Stephen23 el 22 de Feb. de 2016
Armindo's "Answer" moved here:
Hi thank you for the asware.
I do that in a radiobutton but how to do it in a uicontrol text? Because dont seems to work.
Walter Roberson
Walter Roberson el 22 de Feb. de 2016
styles text and edit do not support HTML and do not support superscripts.
You can use another style such as pushbutton, possibly setting the 'enable' property to 'off' (but that might dim the text).
To get any further than this, you would need to go in at the Java level, possibly replacing the Java Swing component that underlies the uicontrol.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by