t=0:0.1:2*pi; >>y1=sin(t); >>y2=cos(t); >>plot(t,y2,'ro') >>close >>t=0:0.01:2*pi; >>y1=sin(t); >>y2=cos(t); >>plot(t,y2,'ro') >>hold on >>plot(t,y1) >>title('正弦余弦函数图象') >>xlabel('x轴') >>ylabel('y轴') >>legend('y=cos(x)','y=sin(x)')
12月21日 编辑 39baobao.com
t=0:0.1:2*pi; >>y1=sin(t); >>y2=cos(t); >>plot(t,y2,'ro') >>close >>t=0:0.01:2*pi; >>y1=sin(t); >>y2=cos(t); >>plot(t,y2,'ro') >>hold on >>plot(t,y1) >>title('正弦余弦函数图象') >>xlabel('x轴') >>ylabel('y轴') >>legend('y=cos(x)','y=sin(x)')