Why MATLAB cannot render $\Beta$ (LaTeX string) in xlabel, ylabel?

조회 수: 6(최근 30일)
qilin guo
qilin guo 2021년 10월 22일
답변: Walter Roberson 2021년 10월 22일
Hello, everone!
By accident I find MATLAB cannot render $\Beta$ (LaTeX string) in xlabel, ylabel? I have set the "interpreter" to "latex". Is this means that MATALB does not support the whole Greek alphabet? I am using MATLAB R2021b (trial version). This is the sample code.
>> xlabel('$\beta$', 'interpreter', 'latex'); ylabel('$\Beta$', 'interpreter', 'latex')
Warning: Error updating Text.
String scalar or character vector must have valid interpreter
syntax:
$\Beta$
Besides, "$\Gamma$" works.
Thank you!

채택된 답변

millercommamatt
millercommamatt 2021년 10월 22일
For an upper case beta, just use B and not \Beta.
You'll note that characters like an upper case Beta and Epsilon aren't included because you can just use B and E and not \Beta and \Epsilon.

추가 답변(1개)

Walter Roberson
Walter Roberson 2021년 10월 22일
MATLAB's latex does not specifically support Greek. Instead, it supports some mathematical symbols, some of which happen to resemble Greek letters. You can see the chart at https://www.mathworks.com/matlabcentral/answers/14751-greek-alphabet-and-latex-commands-not-a-question?s_tid=srchtitle
Generally speaking, it does not bother to have \ codes for letters that are representable in English.
A B \Gamma \Delta E Z H \Theta I K \Lambda M N \Xi O \Pi P \Sigma T \Upsilon \Phi X \Psi \Omega

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by