|
楼主 |
发表于 2009-7-20 13:45
|
显示全部楼层
回复 8楼 friendchj 的帖子
你运行一下下面这个链接里面的这段程序就知道了,呵呵
http://genial.ycool.com/post.138255.html
- t=0:pi/48:2*pi;
- y1=sin(t);
- y2=cos(t);
- y3=y1.*y2;
- y4=0.5*(y1+y2);
- hold on
- h1=plot(t,y1,'r-')
- h11 = plot(t(1:10:end),y1(1:10:end),'*','MarkerFaceColor','r','MarkerEdgeColor
- ','r');
- h2=plot(t,y2,'b-');
- h22 = plot(t(1:10:end),y2(1:10:end),'.','MarkerFaceColor','b','MarkerEdgeColor
- ','b');
- h3=plot(t,y3,'y');
- h4=plot(t,y4,'g');
- hold off
- [legh,objh,outh,outm]=legend([h1,h2],'y1','y2',1);
- legend boxoff
- % matlab 6.5.1
- set(objh(3),'marker','*');
- set(objh(5),'marker','.');
- % matlab7
- %set(objh(4),'marker','*');
- %set(objh(6),'marker','.');
- legh2=copyobj(legh,gcf);
- [legh2,objh2]=legend([h3,h4],'y3','y4',2);
- legend boxoff
复制代码 |
|