From: diana van dijk on
Hi,

I was wondering if it's possible to introduce a linear constraint in fmincon:
Aeq*x = beq,
where x is the optimized variable X as a function of the state variables i,j,m.
And, beq is the optimized value X from m-1 (so, fixing the optimized X).
What I'm trying to do:

n=3;
m=1:n;

loop over i,j,m...
if (m<n) %if m<n --> X(i,j,m) = X(i,j,m-1)
Aeq=[1 0];
beq=X(i,j,m-1)
elseif (m==n) %if m=n --> X(i,j,m) = unconstrained
Aeq=[];
beq=[];
end

I'm looking forward to suggestions,
Diana