国税局冬季上班时间:Matlab与Latex(公式编辑)

来源:百度文库 编辑:偶看新闻 时间:2024/03/29 19:23:14
作者:佚名    文章来源:http://blog.sina.com.cn/xianfa110
Matlab文本的Interpreter属性使我们能在图形中显示一个较为复杂的公式,例如在公式中除了有希腊字母外,还有分号、根号等数学符号。
当键入:>> set(text,'Interpreter')
Matlab将返回'Interpreter'所包含的属性值:
[ latex | {tex} | none ]。
默认值是tex。
Tex的用法在Matlab的帮助文档里有详细介绍,这里主要介绍一下如何采用latex编辑公式。
在matlab中,Latex编辑公式的基本格式:
\( 数学公式 \),或者$ 数学公式 $,或者$$ 数学公式 $$。
具体的公式编辑命令:
1.上标用^和下表用_,希腊字母与tex一样,即\alpha表示α。
2.求和
$$\sum_{i=1}^{n} x_{i}$$
3.积分
$$ \int_{0}^{1}$$
4.求极限
$$\lim_{n \rightarrow \infty}$$  %n趋于无穷符号在lim正下方
$\lim_{n \rightarrow \infty} $ %趋于无穷符号在lim右下角
5. 分式
$$\frac{1}x$$  %1/x
6. 根式
$$\sqrt{x}$$
7. 上划线
$$\overline{x}$$
8. 下划线
$$\underline{x}$$  %下划线在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 $
例:
h = text;
set(h,'Interpreter','latex');
set(h,'string','$$\sum_{i=1}^{n} x_{i}=\int_{0}^{1}f(x)dx$$','position',[0.1,0.5],'FontSize',16);