matlab绘图小知识

x=0:0.2:12
y1=sin(x);
y2=cos(x);
y3=tan(x);
figure(1)
h=plot(x,y1,x,y2,x,y3);
set(h,'LineWidth',2,{'LineStyle'},{'--';':';'-.'})
set(h,{'Color'},{'r';'g';'b'})
axis([0 12 -1 1])
grid on
xlabel('Time')
ylabel('Amplitude')
legend(h,'First','Second','Third')
title('Math Functions')

运行结果:

发布了76 篇原创文章 · 获赞 32 · 访问量 7911

猜你喜欢

转载自blog.csdn.net/wuwuku123/article/details/104259143