How to add a superscript to a uicontrol?
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Walter Roberson
2016-2-21
sprintf('<HTML>New %g<SUP>n</SUP>',2)
Uicontrol have never supported tex or latex. Some uicontrol support HTML.
2 个评论
Walter Roberson
2016-2-22
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!