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 件のコメント

Ajmal Roshan
Ajmal Roshan 2017 年 7 月 28 日
alphamin and alphamax are both matrices defined in the code initially

サインインしてコメントする。

 採用された回答

Torsten
Torsten 2017 年 7 月 28 日
編集済み: Torsten 2017 年 7 月 28 日

0 投票

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

1 件のコメント

Ajmal Roshan
Ajmal Roshan 2017 年 7 月 28 日
Thank you very much. It works Torsten
Ajmal Roshan

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFunction Creation についてさらに検索

質問済み:

2017 年 7 月 28 日

コメント済み:

2017 年 7 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by