matlab 老说我Subscripted assignment dimension mismatch.这是我的代码a=[0,2,2,0,-3,0];l=length(a);w=(0:0.1:100);p=length(w);yw=zeros(p,l-1);for m=1:l-1 for n=1:p if m == 1 yw(n,m)=((a(m)*(1-exp(-1i*w(n)*0.5))/... (1i*w(

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 17:45:31

matlab 老说我Subscripted assignment dimension mismatch.这是我的代码a=[0,2,2,0,-3,0];l=length(a);w=(0:0.1:100);p=length(w);yw=zeros(p,l-1);for m=1:l-1 for n=1:p if m == 1 yw(n,m)=((a(m)*(1-exp(-1i*w(n)*0.5))/... (1i*w(
matlab 老说我Subscripted assignment dimension mismatch.
这是我的代码
a=[0,2,2,0,-3,0];
l=length(a);
w=(0:0.1:100);
p=length(w);
yw=zeros(p,l-1);
for m=1:l-1
for n=1:p
if m == 1
yw(n,m)=((a(m)*(1-exp(-1i*w(n)*0.5))/...
(1i*w(n))-(a(m+1)-a(m))*exp(-1i*w*0.5)...
/(1i*w(n))+((a(m+1)-a(m))/0.5)*(exp(-1i*w(n)*0.5)-1)*w(n)^2));
else
yw(n,m)=exp(1i*w(n)*0.5*m)*((a(m)*(1-exp(-1i*w(n)*0.5))/...
(1i*w(n))-(a(m+1)-a(m))*exp(-1i*w*0.5)...
/(1i*w(n))+((a(m+1)-a(m))/0.5)*(exp(-1i*w(n)*0.5)-1)*w(n)^2));
end
end
end
yf=zeros(p,1);
while q

matlab 老说我Subscripted assignment dimension mismatch.这是我的代码a=[0,2,2,0,-3,0];l=length(a);w=(0:0.1:100);p=length(w);yw=zeros(p,l-1);for m=1:l-1 for n=1:p if m == 1 yw(n,m)=((a(m)*(1-exp(-1i*w(n)*0.5))/... (1i*w(
我不知道是不是你粗心了,你if m==1条件判断里面那个1i是什么意思,又不是1*i,而且i这个变量在哪?