发布网友 发布时间:2022-04-22 14:31
共1个回答
热心网友 时间:2022-05-26 20:17
程序如下:
x = -pi/2:0.1:pi/2;
sinx = sin(x);
cosx = cos(x);
sin2x = sin(2*x);
cos2x = cos(2*x);
figure;
subplot(2,2,1);plot(x,sinx,'r');title('sin(x)');
subplot(2,2,2);plot(x,cosx,'b');title('cos(x)');
subplot(2,2,3);plot(x,sin2x,'b');title('sin(2x)');
subplot(2,2,4);plot(x,cos2x,'k');title('cos(2x)');
运行结果: