Hi,
i am doing a least square optimasation with LSQNONLIN. The problem is that at a certain point I always get comlex values as result. This is coming from my logarithlc function. So my question is: is it possible to restrict the used parameters to positive values? my code looks sth like this:
options = optimset('MaxIter',10000,'MaxFunEvals',50000,'FunValCheck','on','Algorithm',{'levenberg-marquardt',.005});alfaZ = lsqnonlin(@myfun,fgalfa1,1e-7,1e-3,options);function f = myfun(alfa)global LR Stmp H;f=Stmp(:)-log(LR*alfa(:))+H*alfa(:);end
I already tried around with the options, but it didnt change anything yet. So the problem is that LSQNONLIN tries also negative values for alfa… If anybody has an idea how to overcome this problem, it would be great. Thanks for your help!
Best Answer