duifenyi / 定积分作业.m
ACCC1380's picture
Update 定积分作业.m
2bca7ce verified
2.
% 定义函数
f = @(x) log(1 + x) ./ (1 + x.^2);
% 计算定积分
jifen = integral(f, 0, 1)
%梯形
x=[0.3:0.2:1.5]
y=[0.3895,0.6598,0.9147,1.1611,1.3971,1.6212,1.8325]
I=trapz(x,y)