matlab做线性拟合

学习 时间:2026-03-30 10:09:57 阅读:8345
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

最佳回答

贪玩的飞鸟

繁荣的学姐

2026-03-30 10:09:57

把x,y数据输入matlab中,然后输入cftool1 在界面里点data,输入x和y的值2 点fitting-Newfit-Polynomial-linearpolynomial,然后直接点apply即可!Linear model Poly1:       f(x) = p1*x + p2Coefficients (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这是运行结果。

最新回答共有2条回答

  • 快乐的大雁
    回复
    2026-03-30 10:09:57

    把x,y数据输入matlab中,然后输入cftool1 在界面里点data,输入x和y的值2 点fitting-Newfit-Polynomial-linearpolynomial,然后直接点apply即可!Linear model Poly1:       f(x) = p1*x + p2Coefficients (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这是运行结果。

上一篇 同分母分式加减法和异分母分式加减法要不要约分?

下一篇 学习和把握科学技术的本质特征,发展模式及动力有何现实意义