A homework problem we were assigned asks that we fit a quadratic curve to a set of data points that tells when the snow in a town will be gone. I've been able to generate the graph and fit the curve to the graph fine but I can't figure out how to display what is essentially the x-intercept of the graph.
y=[8 20 31 42 55 65 77 88 95 97 89 72 68 53 44];
x=[1:length(y)];
altx=[1:20];
coefs=polyfit(x,y,2);
curve=polyval(coefs,altx);
plot(x,y,'ro',altx,curve)
axis([0 20 0 100])
That's what I have so far. Any help would be much appreciated.
Best Answer