polyfit function with different values of N.