matlab二维绘图x=0:0.1*pi:4*pi;y=sin(x);z=cos(x);v=[0,15,-2,2];axis(v)subplot(2,2,1);plot(x,y,'--r');xlable('x-axis');ylable('y=sinx');title('sine function image');subplot(2,2,2);plot(x,z,'-b');xlable('x-axis');ylable('z=cosx');title('cosine funct
来源:学生作业帮助网 编辑:六六作业网 时间:2025/01/20 12:09:39
matlab二维绘图x=0:0.1*pi:4*pi;y=sin(x);z=cos(x);v=[0,15,-2,2];axis(v)subplot(2,2,1);plot(x,y,'--r');xlable('x-axis');ylable('y=sinx');title('sine function image');subplot(2,2,2);plot(x,z,'-b');xlable('x-axis');ylable('z=cosx');title('cosine funct
matlab二维绘图
x=0:0.1*pi:4*pi;
y=sin(x);
z=cos(x);
v=[0,15,-2,2];axis(v)
subplot(2,2,1);plot(x,y,'--r');xlable('x-axis');ylable('y=sinx');title('sine function image');
subplot(2,2,2);plot(x,z,'-b');xlable('x-axis');ylable('z=cosx');title('cosine function image' );
subplot(2,2,3);plot(x,y+z,'-.k');xlable('x-axis');ylable('y+z=sinx+cosx');title('sine and cosine fuction image');
subplot(2,2,4),
plot(x,y,'--r')
hold on
plot(x,z,'-b')
plot(x,y+z,'-.k')
legend('y=sinx','z=cosx','y+z=sinx+cosx')
hold off
为什么我的代码运行之后只出现一个图,
matlab二维绘图x=0:0.1*pi:4*pi;y=sin(x);z=cos(x);v=[0,15,-2,2];axis(v)subplot(2,2,1);plot(x,y,'--r');xlable('x-axis');ylable('y=sinx');title('sine function image');subplot(2,2,2);plot(x,z,'-b');xlable('x-axis');ylable('z=cosx');title('cosine funct
x=0:0.1*pi:4*pi;
y=sin(x);
z=cos(x);
v=[0,15,-2,2];axis(v)
subplot(2,2,1);plot(x,y,'--r');
xlabel('x-axis');ylabel('y=sinx');title('sine function image');
subplot(2,2,2);plot(x,z,'-b');xlabel('x-axis');ylabel('z=cosx');title('cosine function image' );
subplot(2,2,3);plot(x,y+z,'-.k');xlabel('x-axis');ylabel('y+z=sinx+cosx');title('sine and cosine fuction image');
subplot(2,2,4),
plot(x,y,'--r')
hold on
plot(x,z,'-b')
plot(x,y+z,'-.k')
legend('y=sinx','z=cosx','y+z=sinx+cosx')
hold off
是xlabel不是xlable