曲线拟合的问题,y=f(x1,x2,x3,x4) matlab怎样做?x1 x2 x3 x4 y0.2 13.6 8503 251 27.47.7 9.9 3658 314 13.95.8 10.8 7307 433 26.87.70 9.70 6717 257 23.87.5 9.8 7609 280 21.75.6 11.3 4271 533 14.66.2 7.6 52169 48 2253.23 9.16 16516 80 44.10.33 11.
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 01:26:23
曲线拟合的问题,y=f(x1,x2,x3,x4) matlab怎样做?x1 x2 x3 x4 y0.2 13.6 8503 251 27.47.7 9.9 3658 314 13.95.8 10.8 7307 433 26.87.70 9.70 6717 257 23.87.5 9.8 7609 280 21.75.6 11.3 4271 533 14.66.2 7.6 52169 48 2253.23 9.16 16516 80 44.10.33 11.
曲线拟合的问题,y=f(x1,x2,x3,x4) matlab怎样做?
x1 x2 x3 x4 y
0.2 13.6 8503 251 27.4
7.7 9.9 3658 314 13.9
5.8 10.8 7307 433 26.8
7.70 9.70 6717 257 23.8
7.5 9.8 7609 280 21.7
5.6 11.3 4271 533 14.6
6.2 7.6 52169 48 225
3.23 9.16 16516 80 44.1
0.33 11.3 17366 85 54.1
0.14 9.5 14245 91 56.6
5.5 9.7 18184 3 31.6
2.3 8.9 33612 250 114.9
3.3 4.6 73927 5 166
1.9 9.7 32175 150 107.5
0.6 9.9 33088 242 142.3
0.22 11.7 18620 567 60.4
1.88 11.76 27885 267 71.6
2.78 10.9 21780 76 58.7
以上是这些数据,我想得到y=f(x1,x2,x3,x4)这个函数表达式.
不用matlab也可以
曲线拟合的问题,y=f(x1,x2,x3,x4) matlab怎样做?x1 x2 x3 x4 y0.2 13.6 8503 251 27.47.7 9.9 3658 314 13.95.8 10.8 7307 433 26.87.70 9.70 6717 257 23.87.5 9.8 7609 280 21.75.6 11.3 4271 533 14.66.2 7.6 52169 48 2253.23 9.16 16516 80 44.10.33 11.
试过了,线性的不行,用二次函数.
format long
A=[...
0.2 13.6 8503 251 27.4
7.7 9.9 3658 314 13.9
5.8 10.8 7307 433 26.8
7.70 9.70 6717 257 23.8
7.5 9.8 7609 280 21.7
5.6 11.3 4271 533 14.6
6.2 7.6 52169 48 225
3.23 9.16 16516 80 44.1
0.33 11.3 17366 85 54.1
0.14 9.5 14245 91 56.6
5.5 9.7 18184 3 31.6
2.3 8.9 33612 250 114.9
3.3 4.6 73927 5 166
1.9 9.7 32175 150 107.5
0.6 9.9 33088 242 142.3
0.22 11.7 18620 567 60.4
1.88 11.76 27885 267 71.6
2.78 10.9 21780 76 58.7]
x=A(:,1:4),Y=A(:,5)
x11=x(:,1).*x(:,1);
x12=x(:,1).*x(:,2);
x13=x(:,1).*x(:,3);
x14=x(:,1).*x(:,4);
x22=x(:,2).*x(:,2);
x23=x(:,2).*x(:,3);
x24=x(:,2).*x(:,4);
x33=x(:,3).*x(:,3);
x34=x(:,3).*x(:,4);
x44=x(:,4).*x(:,4);
X=[x(:,:),x11,x12,x13,x14,x22,x23,x24,x33,x34,x44]
[B,BINT,R] = REGRESS(Y,[ones(length(Y),1),X])
结果:
B =
1.0e+003 *
-1.426098928217992
-0.004076772421011
0.255534919787513
0.000012942581436
0.000845938681439
0.000607150442496
-0.000574488595437
0.000000405451807
-0.000042626483419
-0.011775830339062
-0.000000876232149
0.000008150156703
-0.000000000013441
-0.000000013991054
-0.000000969496753
R =
3.122573422039807
0.447341267999400
-7.343326306615449
2.107836742251767
-6.239492394117182
9.044235126157025
2.238791755625499
4.285551199892858
-2.231536057549363
-1.979307925154075
3.503835830046878
1.414933242530537
-1.426757776398972
-12.052007973319576
14.597045597468522
-5.024612350970848
-1.747668123505179
-2.717435276394376
B就是系数,R就是预测值与实际值的差值.