Curve Fitting (polynomial fitting and interpolation)
古いコメントを表示
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 件のコメント
Matt J
2019 年 7 月 5 日
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.
回答 (1 件)
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.
カテゴリ
ヘルプ センター および File Exchange で Get Started with Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!