How do I put a hat on a character displayed in a text object within a figure in MATLAB?

143 Ansichten (letzte 30 Tage)
I would like to put a hat (^) on a character that is displayed in an X-Label, Y-Label, Z-Label, Title or other text object within a figure in MATLAB.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 27 Jun. 2009
As of MATLAB 7.0 (R14), "LaTeX" has been added as an optional interpreter for text objects in a figure.
In order to put a hat on a character that is to be displayed within a figure, the "Interpreter" property of the text should to be set to "LaTeX" and the equivalent LaTeX command "\hat{x}" should be typed as "$$\hat{x}$$".
For example, to have "x-hat" displayed in the X-Label, do the following:
xlabel('$$\hat{x}$$','Interpreter','Latex')
Another example to have "x-hat" displayed as text is:
text(xp,yp,'$$\hat{x}$$','Interpreter','Latex')
where "xp" and "yp" determine the position of the displayed text.
There are no known workarounds for MATLAB 6.5.1 (R13SP1) or earlier versions.

Weitere Antworten (0)

Kategorien

Mehr zu Labels and Annotations finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by