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

조회 수: 6 (최근 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 CenterFile Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by