Defining variable that takes discrete values using fmincon in MATLAB

37 views Asked by At

I want to optimize a problem with 3 variables which one of them takes just two values; 0.02 and 0.06. I want to define this variable with a continuous bound (for example between 1 and 2) and use the round function to have 1, whenever the algorithm selects a value below 1.5, and 2 whenever it selects a value upper or equal to 1.5. Then use them as an index for mapping to the main 2 values 0.02 and 0.06. Can anyone help me with this issue?

algorithm mfile

costfunction mfile

the way of mapping (an mfile which is sourced in the costfunction)

0

There are 0 answers