5, 10) y = x ** 2figure() plot(x, y, 'r') xlabel('x') ylabel('y') title('title') s
最好的方法是将在 MATLAB 中绘制的图片导出成 eps 格式,然后将该文件插入 LaTeX 中。其中,导出 eps 可以使用 print 函数。例如: >> plot(1:10) >> print -deps epsFig 此时会在 MATLAB 的工作路径下自动生成 eps 文件。 插入LaTeX 时,需要:
figure(1) x=[1:1:10]; y1=x.^2+x; plot(x,y1,'ro'); xlabel('X'); ylabel('y'); legend('y=x^2+x') 直接更改编译器,加$$,发现默认latex字体:legend('$y=x^2+x$','Interpreter','latex') 更改为新罗字体,此处加粗了:legend('$\mathrm{\mathbf{y=x^2+x}}$','Interpreter','lat...
对比,上图为普通字符串,下图为LaTeX公式 一个完整的示例如下。 tau=-2:0.001:2;A=1;B=2;f=3;r_tau=A*sinpi(B*tau).*cospi(2*f*tau)./(pi*B*tau);s_tau=A*sinpi(B*tau)./(pi*B*tau);figure('Position',[100200700450]);plot(tau,r_tau,'-',tau,s_tau,'--r',tau,-s_tau,'--...
plot(1:10) print -deps epsFig This will generate a file called epsFig.eps in your current working directory. You can then include this eps file in your LaTeX document. One method to include an EPS figure in your LaTeX 2E document is as follows: ...
plot() yyaxis right plot() 开网格 grid on 加边框 box on 修改线形、marker、颜色等 详细参考 三维对象的二维视图 view(3) % 斜视图 view(0,90) % XY视图 view(90,0) % YZ视图 view(0,0) % XZ视图 Latex解释器 采用latex解释器生成图注等。注意,matlab的latex解释器无法生成\mathbb字体 ld = legend...
Create your 2D, multiple axes plot, and then convert it to a LaTeX .tex file. Then, include the .tex file in your thesis or paper using pstricks. The code uses the data contained in the figure window, so as long as you can create your 2D plot, it should be converted to a .tex ...
一、\( LaTeX命令 \)二、$ LaTeX命令 $3、$$ LaTeX命令 1、在图像中直接加字符:text('Interpreter','latex','String','$$\sqrt{x^2+y^2}$$','Position',[.5.5],… 'FontSize',16);2、在legend里加 数学字符 h=legend('$$\sqrt{x^2+y^2}$$');set(h,'Interpreter','latex...
plot(x1,y1,选项1,x2,y2,选项2,…,xn,yn,选项n) 例1-6 在同一坐标内,分别用不同线型和颜色绘制曲线y1=0.2e-0.5xcos(4πx) 和y2=2e-0.5xcos(πx),标记两曲线交叉点。 程序如下: x=linspace(0,2*pi,1000); y1=0.2*exp(-0.5*x).*cos(4*pi*x); ...
h=plot(x,y1,x,y2,x,y3); set(h,{'LineWidth'},{2;5;8}) %set(h,{'LineWidth'},{2})==set(h,'LineWidth',2),将所有线宽设置为2 set(h,{'Color'},{'r';'g';'b'},{'LineStyle'},{'--';':';'-.'}) %设置颜色和线宽 ...