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)
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. Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!