第1个回答 2012-10-04
用matlab拟合工具箱
输入cftool,
Linear model Poly2:
f(x) = p1*x^2 + p2*x + p3
Coefficients (with 95% confidence bounds):
p1 = -573.5 (-933.1, -213.8)
p2 = 90.52 (35.53, 145.5)
p3 = -1.595 (-3.398, 0.2093)
Goodness of fit:
SSE: 0.07642
R-square: 0.9618
Adjusted R-square: 0.9236
RMSE: 0.1955
p1,p2,p3就是你要的a,b,c
第2个回答 2012-10-12
clear;clc;
hold on
grid on
x=[0.025,0.05,0.075,0.1,0.125];
y=[0.2974,1.4646,2.1428,1.523,0.8303];
p=polyfit(x,y,2); %用二次函数拟合,p就是a,b,c构成的向量
t=0:0.0001:0.15;
s=polyval(p,t,x);
plot(t,s)
plot(x,y,'r*')
p
结果:
p =
-573.4629 90.5162 -1.5945