How to add a superscript to a uicontrol?

조회 수: 5 (최근 30일)
Armindo
Armindo 2016년 2월 21일
댓글: Walter Roberson 2016년 2월 22일
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

채택된 답변

Walter Roberson
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
Stephen23
Stephen23 2016년 2월 22일
편집: Stephen23 2016년 2월 22일
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 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 CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by