Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

texlabel

Format text with TeX characters

Syntax

Description

example

txt = texlabel(f) converts the MATLAB® expression f into the TeX equivalent for use in text. texlabel converts Greek variable names (for example, lambda, delta, and so on) into a character vector that is displayed as Greek letters. The txt output is useful as an argument to annotation functions such as title, xlabel, and text.

If txt is too long to fit into a figure window, then the center of the expression is replaced with a tilde ellipsis (~~~).

example

txt = texlabel(f,'literal') interprets Greek variable names literally.

Examples

collapse all

Plot a line. Create text that contains TeX characters and add the text to the line plot.

plot((1:10).^2)
txt = texlabel('lambda12^(3/2)/pi - pi*delta^(2/3)');
text(3,90,txt)

If you include the 'literal' argument, texlabel interprets Greek variable names literally. Add text with the literal variable names to the line plot.

text(4,60,texlabel('lambda12^(3/2)/pi - pi*delta^(2/3)','literal'))

Input Arguments

collapse all

Input MATLAB expression, specified as a character vector.

Example: 'theta (degrees)'

Data Types: char

See Also

| | | |

Introduced before R2006a


Was this topic helpful?