Underline a character in a string text
60 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Skander
am 22 Dez. 2013
Kommentiert: Dyuman Joshi
am 27 Mär. 2024
Hi, I try to display a string containing some characters that are underlined or with a hat? Does someone know how to proceed? Thanks
2 Kommentare
Jan
am 22 Dez. 2013
What does "display" exactly mean? Where? In the command window, a title of an AXES, inside a button or in the name of a figure?
Akzeptierte Antwort
Image Analyst
am 23 Dez. 2013
If you use text(), title(), xlabel(), etc. you can use latex which is the default interpreter.
% title('S\underline{tring} now x hat:\hat{x}', 'FontSize', 30, 'Interpreter', 'latex')
title('S\underline{tring}', 'FontSize', 30, 'Interpreter', 'latex')
I couldn't get the hat to work, but the underline worked. MATLAB admits they don't support all LATEX instructions - maybe hat is one of those.
2 Kommentare
Dyuman Joshi
am 27 Mär. 2024
You can use \bar or \overline - the length of the dash is different.
text(0.5, 0.5, 'This is a bar over x - $\bar{x}$', 'Interpreter', 'latex')
figure
text(0.5, 0.5, 'This is a bar over x - $\overline{x}$', 'Interpreter', 'latex')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Desktop finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

