题目与最终结果如下:题目
结果
figure('name','曲线图示例')
subplot(1,2,1)
t=-1:0.1:2;
y=(1+t.^2)./(1+t.^4); %数组使用点除
hold on
plot(t,y,'--r')
axis([-1 2 1 2.25])
grid on
title('第一个曲线的标题')
legend({'曲线1'})
xlabel('x轴')
ylabel('y轴')
text(-0.9,1.15,'$$a > b > 0,c > d > 0 \Rightarrow ac bd$$','Interpreter','latex')
subplot(1,2,2)
x1=-3:0.01:0;
x2=0:0.01:pi;
x3=pi:0.01:5;
y1=2*x1;
y2=x2.*cos(2*x2);
y3=(x3-pi).^2;
hold on
plot(x1,y1,'-','LineWidth',1)
plot(x2,y2,'--','LineWidth',1)
plot(x3,y3,':k','LineWidth',1)
legend({'2x x \leq0','xcos2x 0