| Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) | 
![]()  | 
	
| 		
			
			 | 
		#1 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2011-08-06 
				
				
				
					帖子: 1
				 
				
				
				声望力: 0 ![]()  | 
	
	
	
		
		
			
			 
			
			syms t1 t2; 
		
		
		
		
		
		
		
	N=100; L=0.5; dx=L/(N-1); i=sqrt(-1); u=1.257*10^(-6); e=8.854*10^(-12); o=2*pi/sqrt(u*e); k=o*sqrt(u*e); JJ=zeros(1,N-1); for n=1:N-1 if n==1; J1(n)=0*t1; JJ1(n)=subs(J1(n)); J2(n)=(((n*dx-t1)./dx).*exp(-i*k*sqrt(t1-t2).^2))./(4*pi*sqrt(t1-t2).^2); JJ2(n)=subs(J2(n)); else J1(n)=(((t1-(n-2)*dx)./dx).*exp(-i*k*sqrt(t1-t2).^2))./(4*pi*sqrt(t1-t2).^2); JJ1(n)=subs(J1(n)); J2(n)=(((n*dx-t1)./dx).*exp(-i*k*sqrt(t1-t2).^2))./(4*pi*sqrt(t1-t2).^2); JJ2(n)=subs(J2(n)); end end 下面是程序报错: ??? The following error occurred converting from sym to double: Error using ==> mupadmex Error in MuPAD command: DOUBLE cannot convert the input expression into a double array. If the input expression contains a symbolic variable, use the VPA function instead. Error in ==> QUADmn at 21 JJ1(n)=subs(J1(n)); 我是新手,请各位大师能够在百忙之总给予指点,本人感激不尽!!!  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 |