Matlab绘制简单函数图形,subplot绘制子图(wzl)

    技术2022-07-12  86

    x=[0:0.1:10]; y1=exp(x); y2=sin(x); y3=5*x.^2+2*x+4; y4=sqrt(x); subplot(2,2,1); plot(x,y1); title('test1'); xlabel('x'); ylabel('y'); subplot(2,2,2); plot(x,y2); title('test2'); xlabel('x'); ylabel('y'); subplot(2,2,3); plot(x,y3); title('test3'); xlabel('x'); ylabel('y'); subplot(2,2,4); plot(x,y4); title('test4'); xlabel('x'); ylabel('y');

    输出结果:

    Processed: 0.012, SQL: 9