MATLAB: Error using optimoptions (line 124)

optimoptions

I am getting the error message mentioned in the title while executing following line
opts = optimoptions('fmincon','Algorithm','interior-point');
I tried setting the default path through
restoredefaultpath
savepath
rehash toolboxcache
Still getting the same error. Can someone help?
Thanks

Best Answer

%if true
% code
% end
opts = optimoptions(@fmincon,'Algorithm','interior-point');
Try function handle for passing solver name