Unrecognized function or variable 'getIpOptions'.

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.

답변 (2개)

Adam Danz
Adam Danz 2019년 11월 18일
편집: Adam Danz 2019년 11월 18일

4 개 추천

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

Hello, I have a macbook, I used this instead (I am not sure if it is the correct substitute)
system(fullfile(matlabroot,'toolbox\optim\optim'))
and I get
/bin/bash: /Applications/MATLAB_R2019b.app/toolboxoptimoptim: No such file or directory
Let me also mention that I had this issue, I deleted matlab from my macbook, I installed it again and still I have the same issue.
Adam Danz
Adam Danz 2019년 11월 19일
편집: Adam Danz 2019년 11월 19일
What happens when you execute this line?
which getIpOptions -all
% This is what it shows for me
% C:\Program Files\MATLAB\R2019b\toolbox\optim\optim\getIpOptions.m
Also, what version of matlab are you working with?
I get
'getIpOptions' not found.
I use matlab_R2019b_maci64.
Thanks for the help
Reinstall the Optimization Toolbox
This worked! Thanks!
Unrecognized function or variable 'functionWaterfilling'.this is the error for my code
Could you share the full copy-pasted error message (all of it) and the line of code that is producing the error?
That is an odd name for a function. It would seem more plausible to me that a space got missed in the code and that the line should be
function Waterfilling
If you are looking at QoS-aware resource allocation in wireless communication systems by Chi En, Huang then the code for function Waterfilling is included in the paper.
Nice digging, Walter!
Here's the URL to that dissertation
That matches where I found the code... I was hoping there was a better location as the presentation of the Full Text through that link is hard to read.
Fortunately there are marginal comments for nearly every line of the code so it shouldn't be too difficult to put it into Matlab.
BTW, @Latha Maheswari S, the code starts on page 169 of the dissertation and you can search the file for the WaterFilling keyword for additional references.
Jarry
Jarry 2021년 12월 15일
편집: Jarry 2021년 12월 15일
Reinstalling the Optimization Toolbox from Matlab Installer works for me (Ubuntu). Thanks @Walter Roberson
Dev Vaibhav
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
uma 2020년 3월 5일
편집: Walter Roberson 2020년 3월 5일

0 개 추천

[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

X = rand(23,11);
Y = rand(3,11) ;
metric = 'cosine' ;
result = pdist2(X, Y, metric) ;

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Eigenvalues & Eigenvectors에 대해 자세히 알아보기

질문:

2019년 11월 18일

편집:

2022년 3월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by