I need to use the polyfit command to determine the best exponential coefficients for the following two-terms equation:
y= a1 * exp(b1*x1^2+b2*x2^2+b3*x1*x2+b4*x1+b5*x2)
For the simplest situation (y= a* exp(kx)) I would proceed like this:
yeqn = @(coefs, x) coefs(1).*exp(coefs(2).*x); xi = x; eta = log(y); P = polyfit(xi, eta, 1); MyCoefs(1) = exp(P(2)); MyCoefs(2) = P(1)
is there any chance to do the same thing for my situation or should I use another approach?
Best Answer