Borrar filtros
Borrar filtros

How can I make an exponential fit with offset?

45 visualizaciones (últimos 30 días)
twig27
twig27 el 26 de En. de 2017
Comentada: Star Strider el 24 de Sept. de 2018
Hello, since Matlab does not provide a built-in exponential fit function with an offset I would like to create one by myself. I use the Curve Fitting Tool and enter as a custom equation: f(x) = a*exp(b*x)+c However the tool is not performing a correct fit. If I use the built-in exponential fit (2 terms) I obtain a smooth fit, where the time constant of the second term is set to zero and thereby creating the correct offset. Do I have to adjust the start values or why is the custom equation not yielding a good fit? Regards

Respuestas (2)

Star Strider
Star Strider el 26 de En. de 2017
The easy way is to create your own anonymous function:
f = @(b,x) b(1).*exp(b(2).*x) + b(3);
  4 comentarios
patrick
patrick el 24 de Sept. de 2018
Thank you Star Strider!
Star Strider
Star Strider el 24 de Sept. de 2018
@patrick —
My pleasure!

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 24 de Sept. de 2018
You can use fitnlm() in the attached test.m file.

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by