How to fit custom polynomial equation?

7 visualizaciones (últimos 30 días)
Vick
Vick el 26 de Mzo. de 2020
Editada: John D'Errico el 26 de Mzo. de 2020
Following is the poly32 model,
equation(x,y) = p00 + p10*x + p01*y + p20*x^2 + p11*x*y + p02*y^2 + p30*x^3 +
p21*x^2*y + p12*x*y^2
In the above equation i dont want p12*x*y^2 during my curve fitting(i.e. p12 should be zero). How can i achieve it?

Respuesta aceptada

John D'Errico
John D'Errico el 26 de Mzo. de 2020
Editada: John D'Errico el 26 de Mzo. de 2020
You could download polyfitn from the file exchange.
But if you already know how to use the curve fitting toolbox, then just specify a custom equation of the desired form. Something like this:
modelform = fittype('p00 + p10*x + p01*y + p20*x^2 + p11*x*y + p02*y^2 + p30*x^3 + p21*x^2*y',...
'coeff',{'p00','p10','p01','p20','p11','p02','p30','p21'},...
'indep',{'x','y'},'depend','z');
It will be treated as a nonlinear model internally as a function of the parameters, but since all of the coefficients actually do enter linearly, they will be easy to fit. fit should have no problems.

Más respuestas (0)

Categorías

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

Etiquetas

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