In linear regression, results from two approach are the same.
>> x = 1:10;>> y = x * 2 + randn(1, 10);>> b = [ones(1, 10); x]' \ y'b = -0.7021 2.2412>> p = polyfit(x, y, 1);p = 2.2412 -0.721
I can see the implementation of `polyfit` by typing `edit polyfit`. However, I can't see the built-in function `ldivide`
Best Answer