Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
upper index

Subject: upper index

From: jan toth

Date: 4 Mar, 2010 17:07:01

Message: 1 of 3

hello!

I would like to insert to the pushbutton such text : αatm but "atm"

should be like "lower index" , so a don´t have any idea how to do it,

I have tried something like that :

set(handles.pushbutton4,'String','a
\_{atm}','FontName','symbol');

it works ...but "atm" isn´t in lower index

please try to help me

Thanks!

Subject: upper index

From: Walter Roberson

Date: 4 Mar, 2010 18:06:09

Message: 2 of 3

jan toth wrote:

> I would like to insert to the pushbutton such text : αatm but "atm"
>
> should be like "lower index" , so a don´t have any idea how to do it,
>
> I have tried something like that :
>
> set(handles.pushbutton4,'String','a
> \_{atm}','FontName','symbol');
>
> it works ...but "atm" isn´t in lower index

uicontrols generally support limited HTML, but not tex or latex. I don't
think that the HTML support would extend as far as creating a lower index.

If I recall correctly, Yair Altman has created mechanisms for more
detailed control of uicontrol objects, by going in at the java level.

Subject: upper index

From: Yair Altman

Date: 4 Mar, 2010 22:25:24

Message: 3 of 3

Walter Roberson <roberson@hushmail.com> wrote in message <hmosqi$hoi$1@canopus.cc.umanitoba.ca>...
> jan toth wrote:
>
> > I would like to insert to the pushbutton such text : αatm but "atm"
> >
> > should be like "lower index" , so a don´t have any idea how to do it,
> >
> > I have tried something like that :
> >
> > set(handles.pushbutton4,'String','a
> > \_{atm}','FontName','symbol');
> >
> > it works ...but "atm" isn´t in lower index
>
> uicontrols generally support limited HTML, but not tex or latex. I don't
> think that the HTML support would extend as far as creating a lower index.
>
> If I recall correctly, Yair Altman has created mechanisms for more
> detailed control of uicontrol objects, by going in at the java level.

All uicontrols (save a few quirks) support HTML as a corollary of the fact that they are based on Java Swing components that support HTML: http://UndocumentedMatlab.com/blog/html-support-in-matlab-uicomponents/

In your particular case, use HTML subscripts/superscripts. For example:
set(hButton, 'string', '<html>&alpha;<sub>atm');

(note that using the Symbol font in HTML is discouraged: http://www.alanwood.net/demos/symbol.html - this is why I've used &alpha;)

Yair Altman
http://UndocumentedMatlab.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us