Why is the message for my program Error using + Matrix dimensions must agree.??
显示 更早的评论
Vf=zeros(numel(rn),numel(rn));
for c=1:numel(rn)
for b=1:Lc
Tnf(c)=(1/sqrt(rn(c).^2+(G+1-zn(c)).^2))-(1/sqrt(rn(c).^2+(G+1+zn(c)).^2));
W1nf(c,b)=log((Aj(b)+zn(c)+sqrt(rn(c).^2+(Aj(b)+zn(c)).^2))/(Aj(b)-zn(c)+sqrt(rn(c).^2+(Aj(b)-zn(c)).^2)));
Pijf= [W1nf,Tnf'];
Vf=Vf+Pijf.*Q1ij(j);
end
end
I have checked the size of the variables. they are matching.why this is showing error using plus?? Whether i have to set Vf to same dimensions..(j and rn is defined). Vf,Pijf,W1nf,Tnf are arrays...
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Debugging and Improving Code 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!