## CSDN博客

### 在MATLAB中,希腊字母是怎么输入的

Matlab图形中允许用TEX文件格式来显示字符。使用/bf/it/rm表示黑体，斜体，正体字符，特别注意大括号{ }的用法。

1
、画图
x=0:0.01:8;
y=sin(x);
plot(x,y)
2
、写字

This {/bfis a sin} {/itcurve.} I {/itlike it} {/rmvery much.}
y=x^{abcd}
y=x_{abcd}
/int_{x_0}^{x_n}
3
，直接在命令窗口输入
t=['y1(/alpha)=sin(/alpha)','  y2(/theta)=/int_0^{2/pi} sin(/beta)']
gtext(t);

texlabel,

>> f='x^2'
f =
x^2
>> texlabel(f,'literal')
ans =
{x}^{2}

Examples:
texlabel('sin(sqrt(x^2 + y^2))/sqrt(x^2 + y^2)')
returns
{sin}({sqrt}({x}^{2} + {y}^{2}))/{sqrt}({x}^{2} + {y}^{2})

texlabel(['3*(1-x)^2*exp(-(x^2) - (y+1)^2) - 10*(x/5 - x^3 - y^5)*' ...
'exp(-x^2-y^2) - 1/3*exp(-(x+1)^2 - y^2)'])
returns
{3} ({1}-{x})^{2} {exp}(-({x}^{2}) - ({y}+{1})^{2}) -...- {1}/{3} {exp}(-({x}+{1})^{2} - {y}^{2})

texlabel('lambda12^(3/2)/pi - pi*delta^(2/3)')
returns
{/lambda_{12}}^{{3}/{2}}/{/pi} - {/pi} {/delta}^{{2}/{3}}

texlabel('lambda12^(3/2)/pi - pi*delta^(2/3)','literal')
returns
{lambda12}^{{3}/{2}}/{pi} - {pi} {delta}^{{2}/{3}}

[原创]Matlab图形上附加各种文字数学符号
Matlab

1
、画图
x=0:0.01:8;
y=sin(x);
plot(x,y)
2
、写字

This {/bfis a sin} {/itcurve.} I {/itlike it} {/rmvery much.}
y=x^{abcd}
y=x_{abcd}
/int_{x_0}^{x_n}
3
，直接在命令窗口输入
t=['y1(/alpha)=sin(/alpha)','  y2(/theta)=/int_0^{2/pi} sin(/beta)']
gtext(t);

0 0