zzylzz 发表于 2010-8-26 16:26

梯形公式求积分问题

Lk=M*Lamplifier;
sumtotal=0;
img=0
deltf=1e10;
for i=1:1:length(M)
delt_belt=(2*pi*deltf)^2;

nn=15;
z=linspace(Lk(i),Ls,nn);
y=gama*exp(-a*z-j*delt_belt*z*belt2/2);
h=(max(z)-min(z))/(nn-1);
ff(1:nn)=y(1:nn);
q=(ff(1)+2*sum(ff(2:nn-1)+ff(nn)))*h/2;

错误提示

??? Subscript indices must either be real positive integers or logicals.
Error in ==> figur5 at 52
q=(ff(1)+2*sum(ff(2:nn-1)+ff(nn)))*h/2;
页: [1]
查看完整版本: 梯形公式求积分问题