Optimization Toolbox | ![]() ![]() |
Converting Your Code to Version 2 Syntax
Most of the function names and calling sequences have changed in Version 2 to accommodate new functionality and to clarify the roles of the input and output variables.
As a result, if you want to use the new versions of these functions, you need to modify any code that currently uses the old function names and calling sequences.
This table lists the functions provided by the Optimization Toolbox and indicates the functions whose names changed in Version 2.
Old (Version 1.5) Name |
New (Version 2) Name |
attgoal |
fgoalattain |
conls |
lsqlin |
constr |
fmincon |
curvefit |
lsqcurvefit |
fmin |
fminbnd |
fmins |
fminsearch |
fminu |
fminunc |
fsolve |
fsolve (name unchanged) |
fzero |
fzero (name unchanged) |
|
lsqnonlin |
minimax |
fminimax |
|
lsqnonneg |
lp |
linprog |
qp |
quadprog |
seminf |
fseminf |
optimset
and optimget
functions
constr
function to call the new fmincon
function instead
In addition to the information in this section, consult the M-file help for the new functions for more information about the arguments they take. For example, to see the help for fmincon
, type
![]() | Typical Problems and How to Deal with Them | Using optimset and optimget | ![]() |