Assignment has more non-singleton rhs dimensions than non-singleton subscriptsLy = 51; Lx = 501; t = ones(1,8)*alpha/(2*pi);IIn = ones(8,Lx,Ly);IEq (i,:,:) = IEq(i,:,:)+ reshape(t*reshape(IIn,8,Lx*Ly),1,Lx,Ly);Error in ==> radiation at 66IEq (i,:,:) = IEq(i,:,:)+ reshape(t.*reshape(IIn,8,lx*ly),1,lx,ly); % equilibrinm PDFs
问题描述:
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Ly = 51; Lx = 501; t = ones(1,8)*alpha/(2*pi);IIn = ones(8,Lx,Ly);
IEq (i,:,:) = IEq(i,:,:)+ reshape(t*reshape(IIn,8,Lx*Ly),1,Lx,Ly);
Error in ==> radiation at 66
IEq (i,:,:) = IEq(i,:,:)+ reshape(t.*reshape(IIn,8,lx*ly),1,lx,ly); % equilibrinm PDFs
答
Ly = 51;
Lx = 501;
alpha=8;
t = ones(1,8)*alpha/(2*pi);
IIn = ones(8,Lx,Ly);
IEq=zeros(10,501,51);
for i=1:1
IEq(1,:,:)=IEq(1,:,:)+reshape(t*reshape(IIn,8,Lx*Ly),1,Lx,Ly);
end
IEq
运行后,不知是否是您想要的结果?
没有出现您所说的那个问题.
分分分,哈哈