Waruna Maddumage
Subscriber

Thanks, your suggestion helped. 

Increasing the significance of the coefficients solved the issue. Using Matlab polyfit is the better choice.