Error in fmincon - getIpOptions is coming as unrecognized function or variable

This is the exact error below:
Unrecognized function or variable 'getIpOptions'.
Error in fmincon (line 832)
options = getIpOptions(options,sizes.nVar,mEq,flags.constr,defaultopt,10,0.01);
How do i solve this error and move forward ?

Answers (1)

The file 'getIpOptions.m' should be stored in the directory identified below. You can 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. You may 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 does not exists, you can reinstall Optimization Toolbox to resolve the issue.

6 Comments

I used your code: winopen(fullfile(matlabroot,'toolbox\optim\optim'))
I recieved this:
Error using winopen (line 37)
The specified file does not exist.
I have not installed the Optimization Toolbox, I am using the basic MATLAB software.
Do i need the Optimization toolbox to remove my error ?
Which optimization toolbox do i need to 'Optimization Toolbox' or 'Global Optimization Toolbox' ?
Work-around: use an algorithm other than Interior-Point.
I have no idea what that means, can you please elaborate ?
My algorithm is a bit complex. I can think around fmincon and get the minimum value, but dont want to get stuck in a local minima value.
Is there another function or method i can use ?
I have attached my file you/anyone can have a look. This is is my master thesis so i will requre the toolbox for 2+ months and not a 30 day trial. An alternative solution will be more suitable for me.
You require the Optimization Toolbox. You can use the following command to view all the installed MATHWORKS products
ver
It looks like you are licensed for 'Optimization Toolbox'. To install the toolbox you can refer to this.
If the toolbox has already been installed, try reinstalling it.
"interior-point" is the default option for most cases, but you can use optimset() to select a different one. If your choice is not compatible with your system of equations, it will tell you before doing much work.
getIPOptions() stands for "get Interior Point options", and is only used if Interior Point is the active algorithm. If getIPOptions is not available then choose a different Algorithm.
Thank you for your help Walter and Chidvi !
I have installed the 'Optimization Toolbox' and my problem has been solved.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!