Curve Fitting (polynomial fitting and interpolation)

14 visualizaciones (últimos 30 días)
Mohan Gopal Tripathi
Mohan Gopal Tripathi el 25 de Jun. de 2019
Editada: Matt J el 5 de Jul. de 2019
Hello,
I am working on surface fitting of data. I am using "fit" function to perform polynomial fitting and interpolation for surface fitting. It is very sucessfull and i have no problem with it.
I have also used "griddata" for linear interpolation. This method is also very sucessfull.
While using "griddata", when i need to find the unknown z(z_req) from known x(x_req) and y(y_req), i use the below piece of code to do it :
x_req=0.8668;
y_req=0.1114;
z_req= griddata(xnew,ynew,znew,x_req,y_req,'linear');
it gives me the value for z , it is working fine.
Now i need to find the unknown z by using "fit" function, and i was not yet able to do it like i did with "griddata".
Is there any method to find the unknown z with the help of "fit" function in surface fitting?
  1 comentario
Matt J
Matt J el 5 de Jul. de 2019
I am using "fit" function to perform polynomial fitting and interpolation for surface fitting.
Your terminology is confusing. Curve fitting and interpolation are different things.

Iniciar sesión para comentar.

Respuestas (1)

Matt J
Matt J el 5 de Jul. de 2019
Editada: Matt J el 5 de Jul. de 2019
fit() will return a fitobject, which you can use to evaluate the surface at any point you wish
zq=fitobject(xq,yq)
It's important to understand that zq is is the value of the fitted surface at the point [xq,yq]. It is not an interpolated value, because the surface may not pass through the points you used to perform the fit.

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by