MATLAB: Is there a documentation error in the “Example::Minimizing De Jong’s Fifth Function.” in Genetic Algorithm and Direct Search Toolbox 2.1 (R2007a)

dejong5fcnGlobal Optimization Toolboxsimulannealbnd

The example states that the following should be typed at the command line:
fun = @dejong5fcn;
[x fval] = simulannealbnd(@fun, [0 0])
However, this results in an error due to the wrong syntax being used (i.e. @fun)

Best Answer

This is an error within the documentation for Genetic Algorithm and Direct Search Toolbox 2.1 (R2007a). The documentation should implement the correct syntax as follows:
fun = @dejong5fcn;
[x fval] = simulannealbnd(fun, [0 0])