File size: 188 Bytes
afb0d83
 
 
 
 
 
2bca7ce
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
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)