MATLAB Answers

Unrecognized function or variable 'getIpOptions'.

504 ビュー (過去 30 日間)
Antonios Nasioulas
Antonios Nasioulas 2019 年 11 月 18 日
編集済み: Walter Roberson 2020 年 3 月 5 日
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
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)
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?

  12 件のコメント

表示 9 件の古いコメント
Adam Danz
Adam Danz 2020 年 2 月 4 日
Nice digging, Walter!
Here's the URL to that dissertation
Walter Roberson
Walter Roberson 2020 年 2 月 4 日
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.
Adam Danz
Adam Danz 2020 年 2 月 4 日
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.


sayima mukhtar
sayima mukhtar 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
Walter Roberson 2020 年 3 月 5 日
X = rand(23,11);
Y = rand(3,11) ;
metric = 'cosine' ;
result = pdist2(X, Y, metric) ;


Community Treasure Hunt

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

Start Hunting!

Translated by