How do I make the output to be only the multiples of 10 using 'intlinprog' ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ha Lim LEE
am 28 Nov. 2018
Kommentiert: Ha Lim LEE
am 28 Nov. 2018
So I'm using 'intlinprog' to find the optimal value for 20 variables, including lb, ub, ueq and eq.
'intcon' has been set for variable x#17 ~#20 since those four must be integer.
My question is, if I want variable x#20 to be only in a multiple of 10, when the range is 0~50, i.e. x #20 = [0, 10, 20, 30, 40, 50], how should I add a new constraint to satisfy my needs?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 28 Nov. 2018
in your formula and constraints multiply x20 by 10 everywhere it is used, but constrain it to be integer 0 to 5
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Programming and Mixed-Integer Linear Programming finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!