Hi, I would like to find the six coefficients a,b,c,d, e and f of the equation z=a+b*x+c*y+d*x^2+e*x*y+f*y^2 to fit data contained in the matrix A=3x6 (with first row : z values, second row: x values and third row : y values)
Thank you very much

답변 (1개)

Star Strider
Star Strider 2015년 7월 27일
편집: Star Strider 2015년 7월 27일

0 개 추천

The easiest way:
z = A(1,:);
x = A(2,:);
y = A(3,:);
B = [ones(size(z(:))) x(:) y(:) x(:).^2 x(:).*y(:) y(:).^2]\z(:);
a = B(1)
b = B(2)
c = B(3)
d = B(4)
e = B(5)
f = B(6)

카테고리

도움말 센터File Exchange에서 Curve Fitting Toolbox에 대해 자세히 알아보기

태그

질문:

2015년 7월 27일

편집:

2015년 7월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by