is it possible to avoid writing the constraints for fmincon into an
m-file? I have a
case where the constraints are automatically created and written to
disk, but sometimes the file system
is not up to date when I call the optimization routine. Therefore I
wondered if
it is possible to use an inline function for the constraints. However,
it looks (to me)
like there is no way of getting two output arguments (C[] and Ceq[])
out an inline function.
I would be grateful for any suggestions.
- Frank
How about you write 2 inline functions, one to return C and one for CEQ.
Then you can write a m-file that when passed the inline functions
returns both C and CEQ.
Pass the 2 inline functions to FMINCON via the "extra arguments" syntax
(see below) after the "options" argument.
Unfortunately, your objective function will also need to "accept" these
2 extra arguments even though you won't probably need them there.
computeC = inline(......);
computeCEQ = inline(........);
xout ...
= fmincon(FUN,X,A,B,Aeq,Beq,LB,UB,NONLCON,options,computeC,computeCEQ)
Will this work for you?
-- Mary Ann
In article <3BE2CA59...@lfpt.rwth-aachen.de>, alsm...@lfpt.rwth-
aachen.de says...