matlab做线性拟合x=[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2]y=[-8,-236,-415,-562,-701,-860,-961,-1082,-1188,-1304,-1405,-1534]拟合方程:y=a+bx求出拟合截距a 拟合斜率b
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/18 20:01:29
matlab做线性拟合x=[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2]y=[-8,-236,-415,-562,-701,-860,-961,-1082,-1188,-1304,-1405,-1534]拟合方程:y=a+bx求出拟合截距a 拟合斜率b
matlab做线性拟合
x=[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2]
y=[-8,-236,-415,-562,-701,-860,-961,-1082,-1188,-1304,-1405,-1534]
拟合方程:y=a+bx
求出拟合截距a 拟合斜率b
matlab做线性拟合x=[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2]y=[-8,-236,-415,-562,-701,-860,-961,-1082,-1188,-1304,-1405,-1534]拟合方程:y=a+bx求出拟合截距a 拟合斜率b
把x,y数据输入matlab中,然后输入cftool
1 在界面里点data,输入x和y的值
2 点fitting-Newfit-Polynomial-linearpolynomial,然后直接点apply即可!
Linear model Poly1:
f(x) = p1*x + p2
Coefficients (with 95% confidence bounds):
p1 = -1325 (-1429, -1222)
p2 = 6.788 (-69.34, 82.92)
Goodness of fit:
SSE: 3.082e+004
R-square: 0.9879
Adjusted R-square: 0.9867
RMSE: 55.51
这是运行结果.