How can I do a linear fit with forced slope?

13 次查看(过去 30 天)
I'm trying to make a best fit of data forcing the slope of a linear fitting...is it possible? How?

采纳的回答

Matt J
Matt J 2013-3-16
编辑:Matt J 2013-3-16
If your data are column vectors x and y and your model is
y=m*x+b
then the solution for b would simply be
b_fit = mean(y-m*x);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by