MATLAB: Double sigmoid fit

sigmoid fit

Hi, I have bell-shaped data that I'd like to fit. Publications with related data use a "fit to the Boltzman equation." I imagine that this means a double sigmoid fit.
The curve fitting tool does not have a related option, any ideas would be greatly appreciated.
Thanks! Stefan

Best Answer

Here is an example of how you could use cfittool to create a sigmoid fit. First, enter these commands in the Command Window.
x = -5:.05:5;
y = tanh(x);
cfittool
In the Curve Fitting Tool, do the following:
  1. Click on the Data... button and import x and y.
  2. Click on Fitting... and then New fit.
  3. Under Type of fit, choose CustomEquations.
  4. In the New Custom Equation window, click on GeneralEquations.
  5. In the Equation: line after the = sign, type in a*exp(-b*x)+c, and click OK.
  6. Finally, click Apply to see a nicefit.