How to solve error in fmincon ?

15 vues (au cours des 30 derniers jours)
Nathalie
Nathalie le 8 Mai 2014
Modifié(e) : HN le 8 Nov 2020
Hi,
what I'm doing wrong so that it displayes error after my specification:
options = optimset('Display','off','Algorithm','active-set');
parameters=fmincon(@SMM2optimconstraint, [10, 0.5, 50, 1.55], A, b, Aeq, beq, lb, ub, options);
Error is:
Error using optimfcnchk (line 286)
NONLCON must be a function.
Error in fmincon (line 436)
confcn = optimfcnchk(NONLCON,'fmincon',length(varargin),funValCheck,flags.gradconst,false,true);
Thanks.

Réponse acceptée

Matt J
Matt J le 8 Mai 2014
You skipped the nonlcon argument. If you have no nonlinear constraints, be sure to pass [] as below.
parameters=fmincon(@SMM2optimconstraint, [10, 0.5, 50, 1.55], A, b, ...
Aeq, beq, lb, ub, [], options);
  1 commentaire
HN
HN le 8 Nov 2020
Modifié(e) : HN le 8 Nov 2020
Thank you Matt J

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Nonlinear Optimization dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by