How do I perform non-linear curve fitting with restraints?
Ältere Kommentare anzeigen
I want to fit data to a biexponential model, where all the parameters need to be positive. I've been using lsqcurvefit but I can't work out how to prevent it returning negative parameters.
start_point = rand(1, 4);
fun = @(params,time) params(1) .* (1-exp(-params(2) * time)) + params(3) .* (1-exp(-params(4) * time));
[Est,Error] = lsqcurvefit(fun,start_point,time,ydata)
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Nonlinear Optimization 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!