expected value of 'exp2' fit for an unavailable data point using available data
2 views (last 30 days)
Show older comments
I have a data set containing 6 values for x and 6 values y. x = 0, 15, 35, 50, 65, 85 and y= 1.2, 1.2 ,1.3, 2.3, 2.1, 4.0. The sum of exponential functions ('exp2') fit to them very well. How can I calculate the expected value for instance for x= 100. I mean what is y for x=100 given the available data and fit functions? I d be very appreciative. Thanks
0 Comments
Answers (1)
Mischa Kim
on 14 Feb 2014
Edited: Mischa Kim
on 14 Feb 2014
Hello Mohammad, you can retrieve the curve fitting parameters using coeffvalues, define an anonymous function, and then evaluate that function at any point you'd like:
curve = fit(x,y,'exp2');
coeffs = coeffvalues(curve);
f_fit = @(x) (coeffs(1)*exp(coeffs(2)*x) + coeffs(3)*exp(coeffs(4)*x));
See Also
Categories
Find more on Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!