% 龙贝格求积公式
%
%
%

clc,clear;
format long
a=1;
b=2;
e=0.00001;

fx=@(x)2/(pi^0.5)*exp(-x);

romberg(fx,a,b,e)

%

clc,clear;
format long
a=0;
b=pi;
e=0.00001;
fx=@(x)x*sin(x);
romberg(fx,a,b,e)

%

clc,clear;
format long
a=0;
b=2;
e=0.00001;
fx=@(x)x*sqrt(1+x^2);
romberg(fx,a,b,e)

%
% 妈呀终于写完了
%
%

x=[4229042.63      4230585.02    4231384.96    4231773.63    4233028.58   4233296.71    4235869.68    4236288.29];

y=[431695.4   441585.8      432745.6 436933.7      428734.4       431946.3 428705.0      432999.5];

z=[1.019 1.023      1.011      1.022      1.020      1.022      1.022      1.023];

plot3(x,y,z,'b.','MarkerSize',0.5) 

%

