Help with fitting linear equation
1 次查看(过去 30 天)
显示 更早的评论
I need help with my HW pls, I have a data set and I have to fit a linear equation on a given data to identify the intercept and the slope
0 个评论
回答(4 个)
Thorsten
2015-11-13
help robustfit
the final exampel contains also a standard linear regression using "regress".
0 个评论
Star Strider
2015-11-13
And a third option:
B = [ones(size(x(:))) x(:)]\y(:);
slope = B(2)
intercept = B(1)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!