Best Cubic Polynomial fitting
20 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a data set (a versus b, see the attached file and the attached figure).
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.
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. 0 Commenti
Risposte (1)
Torsten
il 22 Gen 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)
0 Commenti
Vedere anche
Categorie
Scopri di più su Linear and Nonlinear Regression in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!