题目非常简单,只是不知道为什么前段时间没有看到这个题。
x=0:100;u11=1/(1+exp(-05(x-685)));
u21=exp(-1/2((x-557)/6)^2);
u22=exp(-1/2((x-38)/10)^2);
u12=1/(1+exp(05(x-225)));
plot(x,[u11;u12;u21;u22],'k')
grid on
积分区间呢?
%%%==========
a1=03826;
b1=4521;
c1=9185;
a2=05569;
b2=455;
c2=1823;
a3=-003431;
b3=4979;
c3=1148;
a4=02741;
b4=5542;
c4=8593;
%积分上下限
x0=1;
x1=3;
%高斯积分点以及权系数
gx=[-09061799,-05384693,0,05384693,09061799];
gweight=[02369269,04786287,05688889,04786287,02369269];
intf=0;
for i=1:5
x=(x0+x1)/2+(x1-x0)/2gx(i);
intf=intf+gweight(i)(a1exp(-((x-b1)/c1)^2)+a2exp(-((x-b2)/c2)^2)+a3exp(-((x-b3)/c3)^2)+a4exp(-((x-b4)/c4)^2));
end
intf=intf(x1-x0)/2;
intf
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)