Why am I getting this error??!! #fmincon

29 ビュー (過去 30 日間)
Charlotte Massie
Charlotte Massie 2020 年 3 月 31 日
回答済み: Steve Grikschat 2021 年 7 月 6 日
I am getting the following error in my MATLAB code. I have already checked i hvae these functions on my computer.
Check for missing argument or incorrect argument data type in call to function 'classifyBoundsOnVars'.
Error in fmincon (line 525)
xIndices = classifyBoundsOnVars(l,u,sizes.nVar,true);
Error in optm (line 7)
[x,fval] = fmincon(@optmequation,x0,[],[],[],[],[],[],@constraint,options)
  4 件のコメント
hapa_kazi_tu
hapa_kazi_tu 2020 年 6 月 2 日
I solved it by myself :) For some reason there was a copy of fmincon.m in the same folder as the script, and this version seemed to be out of date.
AquilesC
AquilesC 2021 年 7 月 2 日
Yep hapa_kazi_tu, your comment is correct !!!, don´t put any copy of fmincon.m in the same folder where the script is. I have had the same problem as you.

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

回答 (1 件)

Steve Grikschat
Steve Grikschat 2021 年 7 月 6 日
This is likely due to an installation issue.
fmincon is part of Optimization Toolbox, and if you do not have the full installation, fmincon will be there but other internal functions (like classifyBoundsOnVars) may not.
Try calling
which -all classifyBoundsOnVars
If it is not there, then you need to (re-)install Optimization Toolbox.

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by