![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1077050/image.jpeg)
Quadratic extrapolation on a dataset
26 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Is it possible to incorportate quadratic extraplotion on a 1D dataset, without using interp2 function? if so, can anybody demonstrate using a simple 1D array data.
many Thanks
0 Commenti
Risposte (1)
William Rose
il 26 Lug 2022
Yes it is possible. Three points define a quadratic equation. The quadratic equation that passes through (x1,y1), (x2,y2), and (x3,y3) is given by
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1077050/image.jpeg)
This is the second order Lagrange polynomial. It is also called the Lagrange interpolating polynomial. You could also use it to extrapolate, if you wish.
1 Commento
William Rose
il 26 Lug 2022
Here is a function that implements the Lagrange polynomial, and a script that demonstrates the use of the function. The test script does interpolation and extrapolation, to demonstrate that the quadratic polynomial passes through the three nearest points of the known data. Here is a screen shot of a typical result. The test script illustrates the fact that quadratic extrapolation is usually not a good idea.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1077120/image.jpeg)
Vedere anche
Categorie
Scopri di più su Polynomials in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!