Solving a centred and scaled fit

3 vues (au cours des 30 derniers jours)
Rebecca
Rebecca le 11 Avr 2016
Using the following code, I fit a second order exponential [ f1(x) = a*exp(b*x) + c*exp(d*x) ] to my first set of data and solve the expression to find the value of x for which f1(x) = 100:
fit_f1 = fit(A, B, 'exp2');
a = fit_f1.a;
b = fit_f1.b;
c = fit_f1.c;
d = fit_f1.d;
syms x
eqn = a*exp(b*x) + c*exp(d*x) == 100;
solx = solve(eqn,x)
In the fitting a fifth order polynomial [ f2(x) = p1*x^5 + p2*x^4 + p3*x^3 + p4*x^2 + p5*x + p6 ] to my second set of data, I received the warning that 'the equation was badly conditioned', so centred and scaled my data.
Again, I need to solve the resulting expression to find the value of x for which f2(x)=79. Presumably, prior to doing this, I need to take into account the fact that I scaled and centred the data in the curve fitting... I am however, a little stuck on how to do this...I know that the command [p,S,mu] = polyfit(x,y,n), the centering and scaling values are returned in mu...and a polynomial can be evaluated at the point x using y = polyval(p,x,[],mu)...but I am attempting to go the other way!?!
So, any pointers on how to account for the scaling and centering in a curve fitting when solving the expression of the curve would be really appreciated.

Réponses (0)

Catégories

En savoir plus sur Fit Postprocessing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by