matlab编程时,总会出现In an assignment A(I) = B, the number of elements in B and I must be the same.

这是我的代码
function ed=im_tingji_value(T)
st=[5 20 129 11 12 121 10 10 11 5 11 11 11 11 11 8 10 11 17 6 12];
save ('no_st','st','-ASCII')
load no_st
t(1)=0;
T(1)=0;
d(1)=0;
a1=0.0024;
a2=0.1895;
a3=0.0520;
n=21;
sums=0;
for i=2:n;
T(i)=no_st(i-1);
T(i)=T(i)+T(i-1);
t(i)=T(i);
f1=@(y)((1-exp(-a1.*(y-t(i-1))))-(1-exp(-a1.*(y-t(i)))));
d(i)=(i-1).*T;
ENf1(T)=a2.*((1-a3).^(n+1-i)).*(quadv(f1,d(i-1),d(i)));
sums=sums+ENf1(T);
end
f2=@(y)(1-(1-exp(-a1.*(y-t(n)))));
ENf2(T)=a2.*quadv(f2,d(n),d(n+1));
ENf(T)=sums+ ENf2(T);
ed=(7.*ENf(T)+2)/T;

在调用函数时,总会出现In an assignment A(I) = B, the number of elements in B and
I must be the same. 请精通Matlab的朋友帮忙解决一下,看看是什么地方错了。谢谢!

第1个回答  2012-05-17
你的程序里没出现A(I)和B矩阵哦~你是在哪里用的那两个矩阵呢?很有可能的原因就是你
“定义”的A矩阵维数和B不一样
相似回答
大家正在搜