MATLAB: How to plot the confidence bounds for an exponential fit

curve fittingplotprogramming

Hi, I'm dong a fit of my data with an exponential fit.When I rum my program , I get the coefficient a ,b, and the coefficient bounds. Exemple: General model Exp1: f(x) = a*exp(b*x) Coefficients (with 95% confidence bounds): a = 1.842 (1.755, 1.929) b = -0.002508 (-0.002784, -0.002232) Do you know how to add the plot of the coefficient bounds at the fitted curve? Thank you in advance

Best Answer

You mean something like this?
a = [1.842; 1.755; 1.929];
b = [-0.002508; -0.002784; -0.002232];
x = linspace(-10,50,100);
y_fit = a(1)*exp(b(1)*x);
y_cbl = a(2)*exp(b(2)*x);
y_cbh = a(3)*exp(b(3)*x);
plot(x,y_fit,'r',x,y_cbl,'b:',x,y_cbh,'b:')
Related Question