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')
运行结果: