exponential fit base 10
Mostrar comentarios más antiguos
hello, i want to fit a exponential function (base 10) to my data i tried use this code :
ft2 = fittype('a + b * 10^(-c*freq)','dependent',{'absol'},'independent',{'freq'},'coefficients',{'a','b','c'});
f2 = fit(freq,absol,ft2);
plot(f2,freq,absol);
but the fit I got was a const line. not a exponential one. any idea what my problem may be? thank.
Respuesta aceptada
Más respuestas (1)
Jos (10584)
el 6 de Mzo. de 2018
Your plot command is incorrect, it seems (f2 is the fit result, not an x-value). So, try this:
plot(freq, f2(freq), 'r-')
3 comentarios
sarel aharoni
el 6 de Mzo. de 2018
Jos (10584)
el 6 de Mzo. de 2018
What is the output of fit?
I also think you might want to add a dot before the power symbol in the formula (matrix power vs element-wise power):
a + b * 10 .^ (-c * freq)
sarel aharoni
el 6 de Mzo. de 2018
Categorías
Más información sobre Get Started with Curve Fitting Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!