MATLAB: Fmincon

fmincon

If the matrix Aeq in linear constraint Aeq*x=beq have parameters,how can this kind of problem be solved using the function fmincon to obtain the optimized parameters in matrix A?

Best Answer

Hi Ashley,
do I understand correctly: there are two entries in Aeq which you want to optimize as well? In this case Walter is right: you would need to put into the non linear constraint function (and add to the variables), i.e., your x will be in fact [x_1,...,x_n,A_1,A_2], where A_1 and A_2 do nothing in the objective function, but will be used in the constraint function (something like)
function [c,ceq] = mynonlin(xAll)
x = xAll(1:end-3);
Aeq = [1 xAll(end-1); 0 xAll(end)]; % example
beq = ...;
ceq = Aeq*x-beq;
Titus