What do I do to fit a surface to given data points in MATLAB?

4 ビュー (過去 30 日間)
Danilo NASCIMENTO
Danilo NASCIMENTO 2011 年 8 月 30 日
回答済み: Kengo Nishi 2020 年 7 月 24 日
Does someone here know any command in MATLAB that adjusts a set of points and give me the equation of the surface found?
This is similar to command polyfit but I want for a surface, not a curve.

回答 (4 件)

Gareth Thomas
Gareth Thomas 2011 年 8 月 31 日
Hi Danilo,
Try using the curve fitting toolbox.
Here is the link to:
load franke
f = fit( [x, y], z, 'poly23' )
plot(f, [x,y], z)
Gives the nice answer of:
Linear model Poly23:
f(x,y) = p00 + p10*x + p01*y + p20*x^2 + p11*x*y + p02*y^2 + p21*x^2*y +
p12*x*y^2 + p03*y^3
Coefficients (with 95% confidence bounds):
p00 = 1.118 (0.9149, 1.321)
p10 = -0.0002941 (-0.000502, -8.623e-005)
p01 = 1.533 (0.7032, 2.364)
p20 = -1.966e-008 (-7.084e-008, 3.152e-008)
p11 = 0.0003427 (-0.0001009, 0.0007863)
p02 = -6.951 (-8.421, -5.481)
p21 = 9.563e-008 (6.276e-009, 1.85e-007)
p12 = -0.0004401 (-0.0007082, -0.0001721)
p03 = 4.999 (4.082, 5.917)
I hope that this helps you.
Gareth

dave
dave 2012 年 6 月 4 日
I have the same problem of Danilo. I'm trying your solution, but entering
load franke
There is this error:
Error using ==> load
Unable to read file franke: No such file or directory
Maybe it is due to the absence of the file. Where can I find franke's database file or are there other solutions?
Thanks!
Dave

Image Analyst
Image Analyst 2012 年 6 月 4 日

Kengo Nishi
Kengo Nishi 2020 年 7 月 24 日
It seems that we need to install the curve fitting toolbox.

カテゴリ

Help Center および File ExchangeSpline Postprocessing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by