Borrar filtros
Borrar filtros

Variable in cost function should take only two values.

1 visualización (últimos 30 días)
Mondeep maz
Mondeep maz el 30 de Abr. de 2018
Comentada: Mondeep maz el 5 de Mayo de 2018
How can i set my objective function variable to take only 0 and 1 and not anything in between? I am using ga solver and my objective function is like min(f(x))= x(1) + x(2) + x(3) with constraint that (x(1) +x(2) + x(3))*0.2=0.4. Please help
  6 comentarios
John BG
John BG el 30 de Abr. de 2018
Editada: John BG el 30 de Abr. de 2018
working in binary formay may come handy:
L=dec2bin(randi([0 100],1,1))
uint8(str2num(L(:))')
John BG
Mondeep maz
Mondeep maz el 5 de Mayo de 2018
Thank you for the help guys.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Solver-Based Optimization Problem Setup en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by