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

조회 수: 4 (최근 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