Use the expfit function to perform exponential regression. Exponential functions are common everywhere there is a process that decays or grows to a steady state, such as radioactive decay, the transient response of an RC circuit, or the displacement of an overdamped spring.
1. Define an appropriate dataset.
2. Call the expfit function to find the parameters of an exponential fit.
The parameters fit the following exponential equation:
3. Plot the data and the exponential fit.
The expfit function is unusual among nonlinear fitting functions because it does not require a guess value, although you may supply one if you do not like the results you are getting from the internal guess routine. The internal routine starts from fitting a line to the y values.