MATLAB: The objective function should be maximized. It has 3 variables that all should be optimized, i.e. the optimization should give 3 optimized variables at the end.

objective function - optimization

My objective function also has an indicator function that its value depends on one of those 3 variables which has to be optimized. (if that variable is more than something the indicator function is 1 and if the variable is less than something the indicator function is 0). When I write the objective function in Matlab it asks for the variable that the indicator function depends on that. It is unknown yet, so how can I define this kind of objective function in Matlab?

Best Answer

The objective function is always a function of unknown variables. Whichever solver you are using, you need to code the objective as a function of arbitrary values.
However, I recommend that you avoid the indicator function completely, since it introduces discontinuity and non-differentiability into your function. Do the optimization for two cases and take the best result: in one case constraining the indicator variable to be less than the indicator threshold and in the other case by constraining it to be greater. In each case, the indicator reduces to a known value.