I used polyfit to find the best fit through my X and Y data.
p = polyfit(x,y,4)
After that I used polyval to make a line with the polyfit with other X data
a = [-5 : 0.1 : 15]
line = polyval(p,a)
When I plot this line and when I look at the data, I see that it has intersections with the x-axis. But there is not an exact y=0
My question is, how do I find the (there are 2) intersection points with the x-axis, or atleast the x where y is the closest to 0?
Thanks in advance!