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)
Best Answer