I'm trying to fit a curve to my points by using polyfit, I'm getting normal results for small polynomial degrees, but when i want to use polyfit for bigger polynomial degrees, I get strange results.
This is what I get when for degree of 10:
It's okay and its normal, but when I use polyfit for the degree of 100, I get strange results for the starting points and the ending points:
What's the reason for this strange behavior? How can i fix this?