在命令窗口或独立绘图中通过 LaTeX 的 MATLAB 和数学方程? [英] MATLAB and Math Equations via LaTeX in command window or stand-alone plots?

查看:17
本文介绍了在命令窗口或独立绘图中通过 LaTeX 的 MATLAB 和数学方程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

What I would like to do is have math formula output (via LaTeX) in either a complete and separate plot, solely devoted to math equations, or be able to display math equations (again via LaTeX) in the command window itself.

Is this possible in MATLAB?

Thanks!

解决方案

I'm not sure about the command prompt, but you can add LaTex text to MATLAB plots using text.
For example, this:

figure
set(gcf, 'color', 'white'), axis off     %# Remove axes and set white background
my_text = '$$f_n={x over sqrt{2}}$$';
text('units', 'inch', 'position', [-0.5 3.5], 'fontsize', 14, 'color', 'k', ...
    'interpreter', 'latex', 'string', my_text);

should give you this:

I also suggest that you read this article. This should get you going.

这篇关于在命令窗口或独立绘图中通过 LaTeX 的 MATLAB 和数学方程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆