Hi Guys,
I am doing an optimisation with four design variables X. All four variables must be a positive integers (i.e) not a floating value. I gave diffminchange as 1, but in iterations, FMINCON has floating value for X.
Is there anyway to force FMINCON to increase/decrease by a round number, hence my design variable will always be a round number.
Thanks in advance!!!

 Réponse acceptée

Alan Weiss
Alan Weiss le 2 Sep 2015

0 votes

As the documentation states, all Optimization Toolbox solvers except for intlinprog are for continuous variables. If you need discrete variables such as integers, either use intlinprog or use the Global Optimization Toolbox ga function for mixed-integer optimization.
Alan Weiss
MATLAB mathematical toolbox documentation

1 commentaire

Selvavignesh
Selvavignesh le 2 Sep 2015
Thanks Alan for response. I am executing the code now with ga.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by