How can I find the coeficients alpha, beta of the simple linear regression, using polyfit function?

2 次查看(过去 30 天)
How can I find the coeficients alpha, beta for the X coordinates of the simple linear regression, using polyfit function?

采纳的回答

Torsten
Torsten 2022-12-10
x = (0:0.1:1).';
y = 3*x + 4 + 0.01*randn(numel(x),1);
polyfit(x,y,1)
ans = 1×2
2.9778 4.0097

更多回答(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