在MATLAB中使用LaTex字符的方法


适用于title、xlabel、ylabel、text等命令。

  • 首先附上 Tex 字符即函数表
注:没表示出来的说明太复杂,一般不常用

函数字符

代表符号

函数字符

代表符号

函数字符

代表符号

\alpha

α

\upsilon

Υ

\sim

~

\beta

β

\phi

Φ

\leq

\gamma

γ

\chi

Χ

\infty

\delta

δ

\psi

Ψ

\clubsuit

一个梅花

\epsilon

ϵ

\omega

Ω

\diamondsuit

在MATLAB中使用LaTex字符的方法

\zeta

ζ

\Gamma

Γ

\heartsuit

恒等号

\eta

η

\Delta

Δ

\spadesuit

黑桃

\theta

θ

\Theta

Θ

\leftrightarrow

\vartheta

ϑ

\Lambda

Λ

\leftarrow

\iota

ι

\Xi

Ξ

\uparrow

\kappa

κ

\Pi

Π

\rightarrow

\lambda

λ

\Sigma

Σ

\downarrow

\mu

μ

\Upsilon

Υ

\circ

°

\nu

ν

\Phi

Φ

\pm

±

\xi

ξ

\Psi

Ψ

\geq

\pi

π

\Omega

Ω

\propto

\rho

ρ

\forall

\partial

\sigma

σ

\exists

\bullet

\varsigma

ς

\ni

在MATLAB中使用LaTex字符的方法

\div

÷

\tau

τ

\cong

\neq

\equiv

 

\approx

\aleph

\Im

在MATLAB中使用LaTex字符的方法

\Re

在MATLAB中使用LaTex字符的方法

\wp

在MATLAB中使用LaTex字符的方法

\otimes

\oplus

\oslash

在MATLAB中使用LaTex字符的方法

\cap

\cup

\supseteq

\supset

\subseteq

\subset

\int

\in

\o

ο

\rfloor

在MATLAB中使用LaTex字符的方法

\lceil

在MATLAB中使用LaTex字符的方法

\nabla

在MATLAB中使用LaTex字符的方法

\lfloor

在MATLAB中使用LaTex字符的方法

\cdot

在MATLAB中使用LaTex字符的方法

\ldots

在MATLAB中使用LaTex字符的方法

\perp

在MATLAB中使用LaTex字符的方法

\neg

在MATLAB中使用LaTex字符的方法

\prime

在MATLAB中使用LaTex字符的方法

\wedge

在MATLAB中使用LaTex字符的方法

\times

在MATLAB中使用LaTex字符的方法

\0

\rceil

在MATLAB中使用LaTex字符的方法

\surd

在MATLAB中使用LaTex字符的方法

\mid

|

\vee

在MATLAB中使用LaTex字符的方法

\varpi

在MATLAB中使用LaTex字符的方法

\copyright

©

\langle

在MATLAB中使用LaTex字符的方法

\rangle

在MATLAB中使用LaTex字符的方法

 

 



  • Tex 字符字体的设置

\bf   是 粗体                                 \it   是斜体                                      \sl 是斜体字,少用
\rm 是正常字体                        \fontname{宋体}                     \fontsize{16}
\color{red(green yellow magenta blue black white cyan gray barkGreen orange lightblue)}
_   和  ^ 分别是下标和上标

  • MATLAB 与 LaTex

格式一般通用,即
text('Interpreter','latex','String','$数学公式$', 'Position',[0.5 0.6],'FontSize',24)
xlabel('$数学公式$','Interpreter','LaTex');

h = legend('sin(x)__','2*sin(x)__');
h1 = findobj(get(h,'Children'),'String','sin(x)__');
set(h1,'String','$sin(\hat{x})$','Interpreter','LaTex');

title('$How \ to \ use \ latex \ in \ figure$','Interpreter','LaTex');

其中,String后面用了    '$数学公式$',其实一共有三种:

a.      ' \(  数学公式 )\'
b.    ' $  数学公式 $'
c.    ' $$  数学公式 $$'

第一种不知为什么实验不成功呢。。 
第二种和第三种都可以用,但是是有区别的,各位可以将下面的积分,求极限的符号带入,分别用第二种和第三种来作图,会发现不一样,个人倾向于使用第三种。


数学公式的常用命令有:
1. 如果是Tex字符,直接打出 \alpha 即可。
2. 求和               \sum_{i=1}^{n} x_{i}                                     % n 和 i 也可以不用大括号
3. 积分               \int_0^1                                                                  % 0 到 1 上的积分
4. 求极限        
limn
         % 无穷符号在正下方             
                              $\lim_{n \rightarrow \infty}$                % 无穷符号在右下角
5. 分式              \frac{1}x                                            % 1/x          
6. 根式             \sqrt{x}                                                                     % 根号x
7. 上划线         \overline{x}                                                         % x上面有一横
8. 下划线         \underline{x}
9.  卧式花括号    \ overbrace{x+y+z+w}
10.  仰式花括号  a+\underbrace{b+c+d}
11.  戴帽命令    \hat{o}\ \ \check{o}\ \ \breve{o}
                        \widehat{A+B} \ \ \widetilde{a+b}
                        \vec{\imath}+\vec{\jmath}=\vec{k}
12.  堆砌命令 :   y\stackrel{\rm def}{=} f(x) \stackrel{x\rightarrow 0}{\rightarrow} A   %有用
13.   省略号 :      \cdots \ldots \vdots \ddots 

可以打开你的MATLAB,自己玩玩了。^_^

MATLAB 公式 图表公式   Tex   LaTex 

猜你喜欢

转载自blog.csdn.net/u012814946/article/details/71698875