To fit two exponential decays with an exponential function that shares a time constant in MATLAB, you can use the curve fitting toolbox. Here's an example of how to do it:
main.m615 chars23 lines
In this example, the model function represents the sum of two decaying exponentials, where c(1)
and c(2)
are the coefficients for the amplitudes of the decays. We use lsqcurvefit
to estimate the coefficients that provide the best fit to the data.
Make sure you have the Curve Fitting Toolbox installed in MATLAB, as the lsqcurvefit
function is part of this toolbox.
gistlibby LogSnag