File Exchange

image thumbnail

quadratic equation interpolation

version 1.0 (1.23 KB) by

assume you have a quadratic equation y=ax^2+bx+c.This script determines a, b , c

11 Downloads

Updated

View License

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

Comments and Ratings (4)

Michael

John D'Errico

John D'Errico (view profile)

  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.

Yan Cheng

MATLAB Release
MATLAB 8.1 (R2013a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video