最小二乘法怎么分段拟​合一条曲线?如何确定​分段点?。

17 views (last 30 days)
cannon
cannon on 14 May 2023
Answered: thyboe on 14 May 2023
一条曲线由圆弧+直线+圆弧组成,想用最小二乘法拟合这条曲线,分段点怎么确定?确定之后怎么拟合?已知测量数据入下
-0.0080,0.0000
0.0829,0.8670
0.2931,1.7132
0.6751,2.4970
1.1621,3.2204
1.7893,3.8264
2.5010,4.3284
3.2933,4.6891
4.1309,4.9290
5.0000,5.0040
6,5.0060
7,4.9950
8,5.0080
9,4.9950
10,5.0030
11,4.9960
12,5.0060
13,4.9970
14,5.0050
15,4.9900
16,5.0100
17,4.9980
18,5.0040
19,4.9950
20,5.0070
21,4.9970
22,5.0040
23,4.9910
24,5.0020
25,4.9920
26,5.0020
27,4.9960
28,5.0020
29,4.9950
30.0000,4.9920
30.8695,4.9309
31.7070,4.6900
32.5030,4.3353
33.2075,3.8226
33.8341,3.2172
34.3284,2.4990
34.7079,1.7135
34.9191,0.8674
35.0040,0.0000

Accepted Answer

thyboe
thyboe on 14 May 2023
SSy = 95.91
fx=@(b,x)sqrt(b(3)*x+b(4)*x.^2+b(5)*x.^3).*(x<=b(1))+(x>b(1)).*b(6).*(x<=b(2))+(x>b(2)).*(sqrt(b(3)*(x-b(2)+b(1))+b(4)*(x-b(2)+b(1)).^2+b(5)*(x-b(2)+b(1)).^3));
b =[4.1454 28.699 9.8202 -0.93995 2.7233e-05 4.9984]
RSS = 0.0906461108591
MSe = 0.0024499
R^2 = 0.99905
如图。

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!