matlab2018 在MATLAB中使用LaTex字符不行

我的text连基本的\sqrt{3}都不能转换过来 如:text(0.5,0.5,'\sqrt{3}');
有的能有的不能,比如text(0.6,0.6,'{l}{y}');也不显示分数线,咋回事,求大神解救

matlab默认是用Tex的,你要用Latex要设置翻译器为Latex才可以。

另外分数应该是\frac吧,你这个本来就不是分数

text(0.5,0.5,'$$\sqrt{3}$$','interpreter','latex');
text(0.6,0.6,'$$\frac{l}{y}$$','interpreter','latex')

追问

谢谢啦。
我还要个问题
for i=1:3
m='$$\frac{Rf}{Rg1%d+Rs}$$';
text(0.1*i,0.1*i,m,'interpreter','latex');
end
我想让那个%d 以此输出为1,2,3,这个怎么弄

追答for i=1:3
m=sprintf('$$\\frac{Rf}{Rg1%d+Rs}$$',i);
text(0.1*i,0.1*i,m,'interpreter','latex');
end

温馨提示:答案为网友推荐,仅供参考
相似回答