标签:
转载自http://blog.sina.com.cn/s/blog_60ec9dcb0100x4qq.html
hold on 是当前轴及图形保持而不被刷新,准备接受此后将绘制
hold off 使当前轴及图形不在具备被刷新的性质
>> t=(0:pi/100:pi)‘;
y1=sin(t)*[1,-1];
y2=sin(t).*sin(9*t);
t3=pi*(0:9)/9;
y3=sin(t3).*sin(9*t3);
plot(t,y1,‘r:‘,t,y2,‘-bo‘)
hold on
plot(t3,y3,‘s‘,‘MarkerSize‘,10,‘MarkerEdgeColor‘,[0,1,0],‘MarkerFaceColor‘,[1,0.8,0])
axis([0,pi,-1,1])
hold off
图形
>> t=(0:pi/100:pi)‘;
y1=sin(t)*[1,-1];
y2=sin(t).*sin(9*t);
t3=pi*(0:9)/9;
y3=sin(t3).*sin(9*t3);
plot(t,y1,‘r:‘,t,y2,‘-bo‘)
plot(t3,y3,‘s‘,‘MarkerSize‘,10,‘MarkerEdgeColor‘,[0,1,0],‘MarkerFaceColor‘,[1,0.8,0])
axis([0,pi,-1,1])
hold off
去掉hold on后的图形,只显示最后的一次数据
标签:
原文地址:http://www.cnblogs.com/cleiyang/p/4186253.html