| Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) | 
![]()  | 
	
| 		
			
			 | 
		#1 | 
| 
			
			 普通会员 
			
			
			
			注册日期: 2009-02-22 
				
				
				
					帖子: 91
				 
				
				
				声望力: 18 ![]()  | 
	
	
	
		
		
			
			 
			
			下列两图形的问题出在哪里? 
		
		
		
		
		
		
		
	(一)syms x y t=dsolve('x*Dy-(Dy)^2-y','x'); ezplot(t(1),[-6,6,-4,8],1); cc=get(gca,'Children'); set(cc,'color','r','linewidth',4); i=0; for k=-2:0.5:2 i=i+1; subplot(3,3,i); ezplot(subs(t(2),'C1',k),[-6,6,-4,8],2); title('results of equations'); end (二)syms x y t=dsolve('x*Dy-(Dy)^2-y','x'); cc=get(gca,'Children'); set(cc,'color','r','linewidth',4); i=0; for k=-2:0.5:2 i=i+1; subplot(3,3,i); ezplot(subs(t(2),'C1',k),[-6,6,-4,8],1); title('results of equations'); end ezplot(t(1),[-6,6,-4,8],2);  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#2 | 
| 
			
			 高级会员 
			
			
			
			注册日期: 2008-11-07 
				住址: 湖南长沙 
				
				
					帖子: 233
				 
				
				
				声望力: 22 ![]()  | 
	
	
	
		
		
			
			 
			
			syms x y 
		
		
		
		
		
		
		
	t=dsolve('x*Dy-(Dy)^2-y','x'); ezplot(t(1),[-6,6,-4,8],1); cc=get(gca,'Children'); set(cc,'color','r','linewidth',4); i=0;figure for k=-2:0.5:2 i=i+1; subplot(3,3,i); ezplot(subs(t(2),'C1',k),[-6,6,-4,8],2); title('results of equations'); end 在i=0这句话后面加上figure,就好了。因为第一段程序中你调用了当前图形,进行设置。但是循环的画图里面没有释放当前图形,因此9个子图的第一个图形是画不出来的  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 |