3.绘制分段函数曲线并添加图形标注:
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/11 10:15:06
3.绘制分段函数曲线并添加图形标注:
| 根号下的x 0
| 根号下的x 0
x=1:8;
x1=0:0.1:4;
y1=x1.^0.5;
x2=4:0.1:6;
y2=ones(1,length(x2))*2;
x3=6:0.1:8;
y3=5-x3./2;
x4=8:0.1:10;
y4=ones(1,length(x4));
plot(x1,y1,'k-',x2,y2,'k-',x3,y3,'k-',x4,y4,'k-');
V=[-2,12,-0.5,2.5];
axis(V);
x=0:0.1:2*pi;
y=sin(x);plot(x,y,'r-.')
V=[0,2*pi,-2,2];
axis(V);
title('sin(x)')
x=0:0.1:2*pi;
y=cos(x);plot(x,y,'b:x')
V=[0,2*pi,-2,2];
axis(V);
title('cos(x)')
x1=0:0.1:4;
y1=x1.^0.5;
x2=4:0.1:6;
y2=ones(1,length(x2))*2;
x3=6:0.1:8;
y3=5-x3./2;
x4=8:0.1:10;
y4=ones(1,length(x4));
plot(x1,y1,'k-',x2,y2,'k-',x3,y3,'k-',x4,y4,'k-');
V=[-2,12,-0.5,2.5];
axis(V);
x=0:0.1:2*pi;
y=sin(x);plot(x,y,'r-.')
V=[0,2*pi,-2,2];
axis(V);
title('sin(x)')
x=0:0.1:2*pi;
y=cos(x);plot(x,y,'b:x')
V=[0,2*pi,-2,2];
axis(V);
title('cos(x)')