Unrecognized function or variable 'getIpOptions'.
23 次查看(过去 30 天)
显示 更早的评论
I try to use fmincon with options being
options = optimset('Algorithm', 'interior-point', 'Display', 'off', 'MaxIter', 10000);
and this is the error I get:
Unrecognized function or variable 'getIpOptions'.
Error in fmincon (line 822)
options = getIpOptions(options,sizes.nVar,mEq,flags.constr,defaultopt,10,0.01);
Error in model_fitting (line 40)
[parameters_opt,ll_opt]=fmincon(@(x) RW_model(x,learning_data,false), init, [], [], [],
[], lowerBound, higherBound, [], options);
I saw that others have the same issue, but I din't find any solution.
0 个评论
回答(2 个)
Adam Danz
2019-11-18
编辑:Adam Danz
2019-11-18
The file getIpOptions.m should be stored in the directory identified below. Run this line of code which should open the directory where this function is stored and look for that function (for Windows)
winopen(fullfile(matlabroot,'toolbox\optim\optim'))
If the file exists, the path has somehow been removed. Restart Matlab and see if the problem goes away. If it doesn't go away, check your startup.m file (if that file exists) to determine if you're removing important paths. You could also try running restoredefaultpath.
If the file doesn't exist, is it possible that it was deleted?
14 个评论
Jarry
2021-12-15
编辑:Jarry
2021-12-15
Reinstalling the Optimization Toolbox from Matlab Installer works for me (Ubuntu). Thanks @Walter Roberson
Dev Vaibhav
2022-3-2
编辑:Dev Vaibhav
2022-3-2
Thanks @Jarry . In my case, Optimization Toolbox was not installed and surprisingly, matlab did not show any error which directly says that the toolbox is not installed. Had to figure out a little bit to install the toolbox as well. But finally it worked !
uma
2020-3-5
编辑:Walter Roberson
2020-3-5
[at this point the user had a copy of the Mathworks pdist2 code]
After excuting this code i get this error:
pdist2(X, Y, metric)
Unrecognized function or variable 'X'.
1 个评论
Walter Roberson
2020-3-5
X = rand(23,11);
Y = rand(3,11) ;
metric = 'cosine' ;
result = pdist2(X, Y, metric) ;
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Communications Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!