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:
Using Latex in GUI (subscript)

Subject: Using Latex in GUI (subscript)

From: Roberto

Date: 21 Sep, 2010 12:16:05

Message: 1 of 4

Good afternoon,

I have created a GUI in Matlab. I created some static text, and I inserted their names in the field 'String', in 'Property inspector'.

But I would like to use subscripts in their names, and I have heard something about using Latex, but I don't know how to enable and how to use it.

For example, if I want to write in 'String', the sampling frequency:
String: fs (but writing s like a subscript), how I can to do that??

Thank you very much.

Subject: Using Latex in GUI (subscript)

From: Steven_Lord

Date: 21 Sep, 2010 13:35:30

Message: 2 of 4



"Roberto " <rober_jimenez1@hotmail.com> wrote in message
news:i7a7m5$c98$1@fred.mathworks.com...
> Good afternoon,
>
> I have created a GUI in Matlab. I created some static text, and I inserted
> their names in the field 'String', in 'Property inspector'.
>
> But I would like to use subscripts in their names, and I have heard
> something about using Latex, but I don't know how to enable and how to use
> it.
>
> For example, if I want to write in 'String', the sampling frequency:
> String: fs (but writing s like a subscript), how I can to do that??

You can't do this directly in a UICONTROL like a static text box; you can do
it in a TEXT object on a graph, though, by using the _ and ^ characters, as
described in the documentation.

http://www.mathworks.com/help/techdoc/creating_plots/f0-4741.html#f0-28104

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Using Latex in GUI (subscript)

From: Roberto

Date: 21 Sep, 2010 15:20:20

Message: 3 of 4

"Steven_Lord" <slord@mathworks.com> wrote in message <i7acb2$a46$1@fred.mathworks.com>...
>
>
> "Roberto " <rober_jimenez1@hotmail.com> wrote in message
> news:i7a7m5$c98$1@fred.mathworks.com...
> > Good afternoon,
> >
> > I have created a GUI in Matlab. I created some static text, and I inserted
> > their names in the field 'String', in 'Property inspector'.
> >
> > But I would like to use subscripts in their names, and I have heard
> > something about using Latex, but I don't know how to enable and how to use
> > it.
> >
> > For example, if I want to write in 'String', the sampling frequency:
> > String: fs (but writing s like a subscript), how I can to do that??
>
> You can't do this directly in a UICONTROL like a static text box; you can do
> it in a TEXT object on a graph, though, by using the _ and ^ characters, as
> described in the documentation.
>
> http://www.mathworks.com/help/techdoc/creating_plots/f0-4741.html#f0-28104
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Thank you,
but then, I cannot either write pi or other symbols in a GUI? Because I need use Latex too.

I cannot create a graph to write a text with it, because I only need text and values.

Subject: Using Latex in GUI (subscript)

From: Yair Altman

Date: 21 Sep, 2010 18:35:20

Message: 4 of 4

> but then, I cannot either write pi or other symbols in a GUI? Because I need use Latex too.
>
> I cannot create a graph to write a text with it, because I only need text and values.


Here is another solution, that support [almost] the complete HTML set, including superscripts, subscripts and special symbols like pi:

http://UndocumentedMatlab.com/blog/customizing-matlab-labels/

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