Spa*_*cey 9 matlab user-interface plot text latex
因此,基于我的问题和解决方案,在这里,我想是看到真正开始使用乳液,数字.但是,我遇到的一个问题是,我似乎无法显示Expectation运算符.
根据我的研究,我知道期望运算符可以正常显示如下:
/mathbb{E}
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试在MATLAB中使用它时,没有打印出来.
clear all
figure(1); clf(1);
set(gcf, 'color', 'white'), axis off %# Remove axes and set white background
my_text = '$$ \mathbb{E} $$';
text('units', 'inch', 'position', [-0.5 3.5], 'fontsize', 14, 'color', 'k', ...
'interpreter', 'latex', 'string', my_text);
Run Code Online (Sandbox Code Playgroud)
现在,我知道\ mathbb是某种不同的'库',但坦率地说它对数学公式非常有用.我如何在MATLAB中"包含"它?我迷失了.
您可能没有注意到它,但在命令提示符中收到警告消息:
Warning: Unable to interpret TeX string
这告诉你MATLAB在解析你的LaTeX表达式时遇到了麻烦.更具体地说,MATLAB的内置LaTeX解释器不支持黑板粗体数学字体(由...表示'\mathbb')(它需要amsmath包).
从这里下载AMS-LaTeX软件包.
修改tex.m位于MATLAB root\toolbox\matlab\graphics文件夹中的m 文件(在修改之前备份文件):
2.1.在该localDecorateInputString函数中,修改standardhead以包含新包(以粗体标记):
standardhead = [' \nofiles \documentclass{mwarticle} \usepackage{amsfonts, amsbsy, amssymb} \begin{document}']
2.2.在该localGetTeXPath函数中,添加AMS包文件所在的路径(以粗体标记),例如:
texpath{1} = blah blah blah...
texpath{end+1} = blah blah blah...
texpath{end+1} = 'C:\amslatex\';
将.styAMS包的所有文件复制到该MATLAB root\sys\tex文件夹.
重启MATLAB.
您现在应该已安装必要的LaTeX字体包.如果时间允许的话,我很乐意自己检查一下,看起来很有希望.