using fmincon function for optimisation

Hey, I was wondering if anyone could explain this. I am using fmincon function for optimisation but gets the following error: Error using fmincon (line 220) FMINCON requires the following inputs to be of data type double: 'Aeq','Beq'.
Error in OptimisationCode1 (line 112) [xalpha,fval,flag]=fmincon(gap,xalphakeep,alphamin,alphamax,@nonlconstr,options);
But I believe both alphamin and alphamax are defined as double by default. Could you please suggest any alternatives?
Ajmal Roshan

1 comentario

Ajmal Roshan
Ajmal Roshan el 28 de Jul. de 2017
alphamin and alphamax are both matrices defined in the code initially

Iniciar sesión para comentar.

 Respuesta aceptada

Torsten
Torsten el 28 de Jul. de 2017
Editada: Torsten el 28 de Jul. de 2017
[xalpha,fval,flag]=fmincon(gap,xalphakeep,[],[],[],[],alphamin,alphamax,@nonlconstr,options);
alphamin and alphamax must be vectors of size "xalphakeep".
Best wishes
Torsten.

1 comentario

Ajmal Roshan
Ajmal Roshan el 28 de Jul. de 2017
Thank you very much. It works Torsten
Ajmal Roshan

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Function Creation en Centro de ayuda y File Exchange.

Preguntada:

el 28 de Jul. de 2017

Comentada:

el 28 de Jul. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by