Hello everybody,
I have an objective function to minimize:
fun=@(x) sqrt(sum((x-d).^2)).
Instead of this function we can also minimize the function
fun=@(x) sum((x-d).^2) ,
so that we have a linear least squares problem. Additional, there are linear constraints. That's why I decided to use lsqlin:
Eye = eye(size(d,1)) [c,fval,residual,exitflag,output,lambda] = lsqlin(Eye,d,A,b,[],[],lb,ub).
For some inputs I get the message
'Exiting: the constraints are overly stringent; no feasible starting point found.'
That's why I tried it with fmincon:
f=zeros(length,1); x0=linprog(f,A,b,[],[],lb,ub); [c,fval]=fmincon(fun,x0,A,b,[],[],lb,ub);
Now the (for me) surprising result: fmincon provides the message 'Local minimum found that satisfies the constraints.' for the same inputs. So: Why does it work for fmincon whereas lsqlin doesn't work for the same inputs?
Thank you for your help!
Diana
Best Answer