Help using fmincon function
Show older comments
I attached a picture of the problem I'm working on.

objecfun is:
function f = objecfun(x)
f = (x(1)-x(2))^2 + (x(2)+x(3)-2)^2 + (x(4)-1)^2 + (x(5)-1)^2;
end
optscript is:
x0 = [2;2;2;2;2];
A = [ ];
b = [ ];
Aeq = [1 3 0 0 0; 0 0 1 1 -2; 0 1 0 0 -1];
beq = [0;0;0];
lb = [-10;-10;-10;-10;-10];
ub = [10;10;10;10;10];
[x,fval] = fmincon('objecfun',x0,A,b,Aeq,beq,lb,ub);
When I run optscript, I keep getting this error:
>> optscript
Warning: The default trust-region-reflective algorithm does not solve problems
with the constraints you have specified. FMINCON will use the active-set
algorithm instead. For information on applicable algorithms, see Choosing the
Algorithm in the documentation.
> In fmincon at 501
In optscript at 8
Warning: Your current settings will run a different algorithm (interior-point)
in a future release.
> In fmincon at 506
In optscript at 8
Local minimum possible. Constraints satisfied.
fmincon stopped because the predicted change in the objective function
is less than the default value of the function tolerance and constraints
are satisfied to within the default value of the constraint tolerance.
<stopping criteria details>
No active inequalities.
Answers (1)
Matt J
on 14 Jan 2015
0 votes
It's not an error. It's a warning. There's no evidence of anything wrong. However, your problem is more appropriate to LSQLIN than to FMINCON, so you might consider using that instead.
Categories
Find more on Linear Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!