请问我的程序段出的问题怎么修改?
M=8; N=5;kesai=0.1:1/10:10;
for s=1:M
for k=1:N
Bessel1(k,:)=besselj(1,(k/N*kesai));
Bessel2(k,:)= besselj(1,((k-1)/N*kesai));
Amedium_k(s,2:101)=2./kesai*exp(i*1/3*pi).*[(k/N)*Bessel1(k,:)-((k-1)/N)*Bessel2(k,:)];
syms x
A=2/x*exp(i*1/3*pi)*[(k/N)*besselj(1,((k/N)*x))-((k-1)/N)*besselj(1,((k-1)/N)*x)];
Amedium_k(s,1)=subs(limit(A,x,0,'right'))
A(s,:)=A(s,:)+Amedium_k(s,:);
end;
I(s,:)=abs(A(s,:)).^2;
end;
??? Assignment has more non-singleton rhs dimensions than non-singleton
subscripts.
Error in ==> zehnfufenbu at 11
A(s,:)=A(s,:)+Amedium_k(s,:); 原帖由 meteor_033 于 2007-4-17 10:26 发表
M=8; N=5;
kesai=0.1:1/10:10;
for s=1:M
for k=1:N
Bessel1(k,:)=besselj(1,(k/N*kesai));
Bessel2(k,:)= besselj(1,((k-1)/N*kesai));
Amedium_k(s,2:101 ...
把中括号换成小括号试试 谢谢!但是换成小括号,还是出现同样的错误 原帖由 meteor_033 于 2007-4-17 15:43 发表
谢谢!但是换成小括号,还是出现同样的错误
你的程序太混乱了,至少两个地方的中括号要修改为小括号,还存在预分配空间,类型转换等问题,请恕我没有时间细看,你还是找本书看看类似的东西吧
页:
[1]