Borrar filtros
Borrar filtros

Best Cubic Polynomial fitting

2 visualizaciones (últimos 30 días)
Naresh Pati
Naresh Pati el 22 de En. de 2019
Respondida: Torsten el 22 de En. de 2019
I have a data set (a versus b, see the attached file and the attached figure). fig1.png I want to find the coefficients p and q of the cubic polynomial b=p*a+q*a^3 that fits the data. Please help.

Respuestas (1)

Torsten
Torsten el 22 de En. de 2019
mat = [a a.^3];
rhs = b;
sol = mat\rhs;
p = sol(1)
q = sol(2)
fun=@(x) p*x + q*x.^3;
bb = fun(a);
plot(a,b,a,bb)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by