matlab的问题?Index exceeds matrix dimensions.for m=1:ND% 分别沿两个方向计算if(anglemu(m)0)Sca=Sca+abs(anglemu(k))*Ipold(Nr+1,:,:,k)*weight(k);endendIpold(Nr+1,:,:,m)=ewallc*T(Nr+1,:,:).^4+1/pi*(1-ewallb)*Sca;endif(anglexi(m)>0) % z方向S
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/18 13:20:42
matlab的问题?Index exceeds matrix dimensions.for m=1:ND% 分别沿两个方向计算if(anglemu(m)0)Sca=Sca+abs(anglemu(k))*Ipold(Nr+1,:,:,k)*weight(k);endendIpold(Nr+1,:,:,m)=ewallc*T(Nr+1,:,:).^4+1/pi*(1-ewallb)*Sca;endif(anglexi(m)>0) % z方向S
matlab的问题?Index exceeds matrix dimensions.
for m=1:ND
% 分别沿两个方向计算
if(anglemu(m)0)
Sca=Sca+abs(anglemu(k))*Ipold(Nr+1,:,:,k)*weight(k);
end
end
Ipold(Nr+1,:,:,m)=ewallc*T(Nr+1,:,:).^4+1/pi*(1-ewallb)*Sca;
end
if(anglexi(m)>0) % z方向
Sca=0;
for k=1:ND
if(anglexi(k)0)
Sca=Sca+abs(anglexi(k))*Ipold(:,:,Nz+1,k)*weight(k);
end
end
Ipold(:,:,Nz+1,m)=ewalld*T(:,:,Nz+1).^4+1/pi*(1-ewalld)*Sca;
end
end
if( m==1)
ER(1:Nr+1,1:Nt,1:Nz+1)=ER(1:Nr+1,1:Nt,1:Nz+1)-max(alpha(m),0)*Ipold(1:Nr+1,1:Nt,1:Nz+1,m+1)/(tau*weight(m));
elseif (m==ND+1)
ER(1:Nr+1,1:Nt,1:Nz+1)=ER(1:Nr+1,1:Nt,1:Nz+1)-max(alpha(m-1),0)*Ipold(1:Nr+1,1:Nt,1:Nz+1,m-1)/(tau*weight(m));
else
ER(1:Nr+1,1:Nt,1:Nz+1)=ER(1:Nr+1,1:Nt,1:Nz+1)-(max(alpha(m),0)*Ipold(1:Nr+1,1:Nt,1:Nz+1,m+1)+max(alpha(m-1),0)*Ipold(1:Nr+1,1:Nt,1:Nz+1,m-1))/(tau*weight(m));
end
matlab的问题?Index exceeds matrix dimensions.for m=1:ND% 分别沿两个方向计算if(anglemu(m)0)Sca=Sca+abs(anglemu(k))*Ipold(Nr+1,:,:,k)*weight(k);endendIpold(Nr+1,:,:,m)=ewallc*T(Nr+1,:,:).^4+1/pi*(1-ewallb)*Sca;endif(anglexi(m)>0) % z方向S
这个问题是程序中引用某个矩阵的数据超出了矩阵大小,比如定义的矩阵是4×4,你来个a(:,5)就成这样了.
具体的你自己检查程序吧