Coefficents not reflecting the curve obtained using fit function
Ältere Kommentare anzeigen
I am trying to write a piece of code that outputs the constants a and b for a curve of the following format:
f(x)=1/(1+exp(1).^(b*(x-a)))
My code (below) is producing the logistic function plot (below) which i believe to be correct, however the coefficients being extracted from the code are not representative of the plot being produced. Is there a fix for this which would mean that the correct values of a and b could be extracyed from the function? Any help would be much appreciated
function [a,b] = fit_lightoff(Temperature,Gas_Conversion)
ft = fittype( '1/(1+exp(1).^(-b*(x-a)))');
options = fitoptions;
options.Normal = 'on';
f=fit(Temperature,Gas_Conversion, ft, options)
MyCoeffs=coeffvalues(f);
a= MyCoeffs(1);
b= MyCoeffs(2);
h = plot( f, Temperature,Gas_Conversion);
end

Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Linear Predictive Coding finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!