Stopping intlinprog if fval isn't changing

Dear All
I'm quite new to Matlab and I'm using it for optimizations. Now I'm trying to define some stopping criteria but I don't get it. How can i stop a intlinprog function if my fval value isn't changing over a certain amount of nodes? Is that even possible?
This is my code so far:
clear all
A = xlsread('Daten_jpd.xlsm','A');
Aeq = xlsread('Daten_jpd.xlsm','Aeq');
beq = xlsread('Daten_jpd.xlsm','beq');
b = xlsread('Daten_jpd.xlsm','b');
lb=xlsread('Daten_jpd.xlsm','lb');
ub=xlsread('Daten_jpd.xlsm','ub');
c=xlsread('Daten_jpd.xlsm','c');
intcon=xlsread('Daten_jpd.xlsm','intcon');
[x,valuef]=intlinprog(c,intcon,A,b,Aeq,beq,lb,ub);
I tried to use
options = optimoptions(@intlinprog,'OutputFcn',@stopFcn);
to include a stop Function, but there i got an error:
Error using optimoptions (line 105)
'OutputFcn' is not an option for INTLINPROG.
A list of options can be found on the INTLINPROG documentation page.
Thanks a lot for your Help!
Cheers yvlu

Respuestas (1)

Alan Weiss
Alan Weiss el 12 de Mzo. de 2015

0 votos

You probably have MATLAB R2014a, which does not have output function support for intlinprog. See the release notes.
Alan Weiss
MATLAB mathematical toolbox documentation

4 comentarios

yvlu
yvlu el 12 de Mzo. de 2015
Thanks a lot Alan, that was the issue. But im still wondering if it's possible to stop the intlinprog when i get the same fval for a certain amount of nodes? If yes, would it be possible to give me a hint?
Cheers Yves
Alan Weiss
Alan Weiss el 12 de Mzo. de 2015
Sorry, that is the functionality of output functions, and is not supported in R2014a.
Alan Weiss
MATLAB mathematical toolbox documentation
yvlu
yvlu el 13 de Mzo. de 2015
Yeah I updated my version to 2015, so I can use an output function now. But I don't know how to formulate this function. When I try to use the otptimValues.fval i always get an error.
Alan Weiss
Alan Weiss el 13 de Mzo. de 2015
Read the documentation carefully.
Alan Weiss
MATLAB mathematical toolbox documentation

Iniciar sesión para comentar.

Categorías

Más información sobre Linear Programming and Mixed-Integer Linear Programming en Centro de ayuda y File Exchange.

Preguntada:

el 12 de Mzo. de 2015

Comentada:

el 13 de Mzo. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by