How to optimize a vector, where only two values are allowed?
Mostrar comentarios más antiguos
Hello,
as you see in the Pseudocode I have an optimization problem with two inputvectors, which I combine as a matrix. This works well so far.
Now I have the problem that the vector v2 can only have two values: 0 and 1. But I don't know how the two values are best distributed over the vector.
So I would like that during running the optimization the best distribution of zeros and ones over the vector v2 is calculated. How can I make this restriction for v2?
Thanks for your help
mExample=[v1,v2];
opts = optimoptions(@fmincon,'MaxIterations',500,'MaxFunctionEvaluations',500);
optFunction = @(mExample)OptimProb(vstativ,mExample);
optProblem = createOptimProblem('fminunc', 'x0', mExample, 'objective', optFunction,'options',opts);
[mExampleSolution, OptimizationCriterion, ~, Output] = run(MultiStart, optProblem, NMultistart);
function OptimizationCriterion = OptimProb(vstatic,mExample)
%calculateOptimizationCriterion from vstatic and mExample
end
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Surrogate Optimization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!