Why do I receive an error about a non-existent field when loading an options argument created in the Optimization Toolbox 2.3 (R13SP1) or earlier into the Optimization Toolbox 3.0 (R14) or later?

1 view (last 30 days)
I saved the workspace, including the optimization options argument, while using the Optimization Toolbox 2.3 (R13SP1). However, when I load the workspace into the Optimization Toolbox 3.0 (R14) and use the options argument as an input to an optimization function, I receive the following error:
??? Reference to non-existent field 'RelLineSrchBnd'.
Error in ==> optimget at 87
o = options.(Names{j,:});
Error in ==> optim\private\nlconst at 105
relLineSrchBnd = optimget(OPTIONS,'RelLineSrchBnd',[]);
Error in ==> fmincon at 498
[X,FVAL,lambda,EXITFLAG,OUTPUT,GRAD,HESSIAN]=...

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
This error occurs when using an options argument created in a version of the Optimization Toolbox prior to version 3.0 (R14) in this version. For example, loading a MAT-file containing data and an options structure that was created and saved in the Optimization Toolbox 2.3 (R13SP1) into the current version leads to the error when the options are used in a function such as FMINCON.
As a workaround, re-create the options argument in the current version. For example, if the options argument is loaded into the MATLAB workspace with the name "opts", re-create it using:
opts = optimset(opts);
before passing it into the optimization function.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!