Thanks for your help. I was testing a polynomial simulation. I set the polynomial to be: y = 1+2x+3x^2+4x^3+5x^4+6x^5 and generated 1000 points. Then I used polyfit(Test1_regressor{:,1}, Test1_points{:,1}, 5); the results are: 5.993278257 5.015586479 3.987602572 3.00393415 1.999564018 1.000009082 But I expected the results should be closer to 6, 5, 4, 3, 2, 1 I wonder how to improve the precision.
Thanks. Jennifer