On 3/14/2013 5:51 PM, Santosh wrote: > I have noticed that the residual in > [X,resnorm,residual,exitflag,output,lambda] = > lsqlin(C,d,A,b,Aeq,beq,lb,ub,X0,options,varargin) > > is CX-d when no constraints are given and it is d-CX when lower and > upper bounds are given. > I am not sure about the cases where equalities and inequality > constraints are given. > > Matlab version R0212b (126.96.36.1993). > It would be good to know if this bug exists for other constraints also > and if someone can do a quickfix. > > -- > Thanks > Santosh
This indeed seems to be a bug that affects the trust-region-reflective algorithm for bound-constrained problems only. The problem is under investigation.
Meanwhile, you can use the active-set algorithm, which seems to produce correct results for all constraint types. Enter options = optimset('LargeScale','off')
Thanks for reporting this problem,
Alan Weiss MATLAB mathematical toolbox documentation