3/26/2008

matlab中画图技巧



例:t=0:0.1:10
y1=sin(t);y2=cos(t);plot(t,y1,'r',t,y2,'b--');
x=[1.7*pi;1.6*pi];//设定不同曲线的位置
y=[-0.3;0.8];
s=['sin(t)';'cos(t)']; // 不同曲线的标题
text(x,y,s);
title('正弦和余弦曲线');
legend('正弦','余弦') //分别不同的曲线
xlabel('时间t'),ylabel('正弦、余弦')
grid on

没有评论: