I have been able to find two different functions, fitnlm and lsqcurvefit. Problem with first function is that I cannot set boundaries for parameters but I can use weights. The problem with lsqcurvefit is, that I can't use weights but I can use boundaries for parameters. Is there another more general function where I can use both weights and boundaries for parameters?
Examples:
mdl = fitnlm(x,y,fun,p0,'Weights',weights)
p = lsqcurvefit(fun,p0,x,y,lb,ub)
I can't use 'Weights' in lsqcurvefit, and I can't use lb and ub in fitnlm. Help me please.
Best Answer