第五章节matlab句柄绘图课件(659KB).pptVIP

  • 25
  • 0
  • 约7.69千字
  • 约 52页
  • 2018-04-01 发布于广东
  • 举报
set(gcf,color,[0.5 0.5 0.5]) set(gcf,color,[0.5 0.6 0.8]) 例:作正弦、余弦曲线,将正弦曲线改为虚 线,将余弦曲线幅度减为1/2高度,如何用 句柄实现。 x=0:2*pi/180:2*pi; y1=sin(x);y2=cos(x); plot(x,y1,x,y2,x,zeros(size(x) ),w:) 首先查询各对象的属性 get(gcf) h=get(gcf,children) h = 60.0004 hh=get(gca,children) hh = 70.0004 69.0004 68.0004 修改属性 y11=get(hh(2),ydata); y22=y11/2; set(hh(2),ydata,y22) set(hh(3),linestyle,:) get(h) get(h,’ propertyname’) set(h) set(h,’propertyname’,value) set(h,’属性名称’,‘新属性’) ‘color’, ’r’ ‘linestyle’, ’:’ ‘figurecolor’, ’m’ 2.对象属性的继承操作 对象属性的继承操作是通过父代对象,设置缺省对象属性来实现的。 父代句柄

文档评论(0)

1亿VIP精品文档

相关文档