Determine coefficients of a quadratic interpolation equation when having 3 values in x,y.
assume you have a quadratic equation y=ax^2+bx+c and have 3 points in x and 3 points in y. This script determines a, b , c
abc = polyfit(x,y,2);
would suffice as well. Polyfit is a bit higher quality code too, and it comes with MATLAB since the last 30 years or so. And polyfit has much more capability.
I do find it somewhat laughable that the code fits a QUADRATIC polynomial, but the picture posted shows a curve fit through 4 points, that is clearly NOT quadratic. Hey, it is that new math I suppose. What will they think of next?
And finally, while the title of the submission says something about interpolation, it does no interpolation for you at all.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.